/* ==========================================================================
   CSS Variables — shared across Rails views and React
   ========================================================================== */

:root {
  --primary-color: #123c27;
  --primary-color-dark: #0f2f20;
  --secondary-color: #b9934b;
  --text-color: #1d241f;
  --page-bg: #fbf7ef;
  --surface-bg: #fffaf2;
  --line-color: #e6dfd3;
  --primary-green: #123c27;
  --primary-red: #8f5c4c;
  --info-color: #456a78;
  --warning-color: #9a7a3a;
  --success-color: #3d6b4a;
}

/* ==========================================================================
   Base — body-level resets (safe, these don't conflict with Tailwind)
   ========================================================================== */

body {
  font-family: "Soehne", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--page-bg);
  margin: 0;
  padding: 0;
}

#react {
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Global element styles — SCOPED TO OUTSIDE #react
   These only apply to server-rendered Rails views (Devise, admin, etc.)
   Inside #react, Tailwind controls everything.
   ========================================================================== */

body:not(:has(#react)) h1,
body:not(:has(#react)) h2,
body:not(:has(#react)) h3,
body:not(:has(#react)) h4,
body:not(:has(#react)) h5,
body:not(:has(#react)) h6,
.devise-wrapper h1,
.devise-wrapper h2,
.devise-wrapper h3,
.devise-wrapper h4,
.devise-wrapper h5,
.devise-wrapper h6 {
  font-weight: bold;
}

body:not(:has(#react)) p,
.devise-wrapper p {
  margin-bottom: 15px;
}

body:not(:has(#react)) a,
.devise-wrapper a {
  color: var(--primary-color-dark);
  text-decoration: none;
}

body:not(:has(#react)) a:hover,
.devise-wrapper a:hover {
  color: var(--primary-green);
}

body:not(:has(#react)) img {
  display: block;
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}

body:not(:has(#react)) label,
.devise-wrapper label {
  display: block;
  margin-bottom: 5px;
}

body:not(:has(#react)) form,
.devise-wrapper form {
  width: fit-content;
  margin-bottom: 20px;
  display: block;
  padding: 10px;
  font-size: 17px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

body:not(:has(#react)) button,
body:not(:has(#react)) input[type="submit"],
.devise-wrapper button,
.devise-wrapper input[type="submit"] {
  display: inline-block;
  padding: 10px 20px;
  font-size: 17px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  background-color: var(--primary-color);
  color: #fff;
}

body:not(:has(#react)) input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Input styles — scoped to non-MUI inputs outside React */
.devise-wrapper input[type="text"],
.devise-wrapper input[type="email"],
.devise-wrapper input[type="password"],
.devise-wrapper input[type="number"],
.devise-wrapper input[type="date"],
.devise-wrapper input[type="datetime-local"],
.devise-wrapper input[type="search"],
.devise-wrapper input[type="tel"],
.devise-wrapper input[type="url"],
.devise-wrapper textarea,
.devise-wrapper select {
  display: inline-block;
  padding: 10px;
  font-size: 17px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
  width: 200px;
}

/* ==========================================================================
   Rails flash messages
   ========================================================================== */

p.notice,
p.alert {
  padding: 10px;
  border: 1px solid #ddd;
  margin-bottom: 15px;
  position: fixed;
  top: 60px;
  right: 20px;
}

p.notice {
  border-color: #d6e9c6;
  background-color: #dff0d8;
  color: #3c763d;
}

p.alert {
  border-color: #ebccd1;
  background-color: #f2dede;
  color: #a94442;
}

/* ==========================================================================
   Layout — header, footer, main
   ========================================================================== */

body:not(:has(#react)) main {
  margin: 0 auto;
  width: 100%;
  padding: 0;
}

body:not(:has(#react)) header {
  background-color: transparent;
  color: var(--primary-color);
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

body:not(:has(#react)) footer {
  background-color: #333;
  color: #fff;
}

/* ==========================================================================
   Component styles — class-scoped, safe with Tailwind
   ========================================================================== */

/* Devise auth pages */
.devise-wrapper {
  padding: 10px;
  margin: 10px auto;
  width: min-content;
}

.disclaimer {
  text-align: left;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
  font-style: italic;
}

@media screen and (max-width: 600px) {
  .notistack-SnackbarContainer {
    bottom: 75px !important;
    display: none !important;
  }
}

/* Snackbar (notistack) variant colors on theme */
.notistack-MuiContent-success {
  background-color: var(--success-color) !important;
}

.notistack-MuiContent-error {
  background-color: var(--primary-red) !important;
}

.notistack-MuiContent-warning {
  background-color: var(--warning-color) !important;
}

.notistack-MuiContent-info {
  background-color: var(--info-color) !important;
}

/* Typography helpers */
.charter {
  font-family: "Charter BT Roman", serif !important;
}

.script {
  font-family: "Charter BT Roman", serif;
}

.devise-wrapper {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 50px;
}

.logo-container {
  text-align: center;
  margin-bottom: 20px;
  padding-top: 10px;
}

.form-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 10px;
  display: block;
}

.form-intro {
  text-align: center;
  color: #666;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.devise-wrapper {
  width: 92%;
  padding: 20px;
  margin-top: 20px;
  max-width: 350px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"] {
  padding: 12px 8px;
  width: 80%;
  font-size: 16px;
}

.actions input[type="submit"] {
  padding: 14px;
  font-size: 18px;
}

.devise-wrapper h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"] {
  width: calc(100% - 20px);
  padding: 12px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="tel"]:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 1px rgba(185, 147, 75, 0.3);
}

.field small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 0.85rem;
}

.checkbox-field {
  display: flex;
  align-items: center;
  margin-top: 20px;
}

.checkbox-field input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.actions {
  margin-top: 25px;
}

.actions input[type="submit"] {
  width: 100%;
  padding: 14px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}

.actions input[type="submit"]:hover {
  background-color: var(--primary-color-dark);
}

.disclaimer {
  margin-top: 20px;
  font-size: 14px;
  color: #666;
  text-align: center;
  padding: 0 10px;
}

.disclaimer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.disclaimer a:hover {
  text-decoration: underline;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *



 */
