/* ===========================================
   LOGIN CUSTOM CSS
   Styling for the admin login window
   =========================================== */

/* ===== HEADER STYLING ===== */
/* NOTE: Header (#header) branding, site name, and fonts are handled by admin-custom.css
   which loads on all admin pages including login. Only login-specific header styling below. */

/* Login header background with brown gradient */
body.login #header {
  background: linear-gradient(90deg, #5c392e 0%, #795939 100%) !important;
  box-shadow: 0 4px 24px rgba(62, 39, 32, 0.12);
}

/* Login branding layout (logo + site name) */
body.login #site-branding {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px;
  padding-left: 8px;
}

body.login #site-name,
body.login #site-name a,
body.login #site-name a:link,
body.login #site-name a:visited {
  color: #fff !important;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif !important;
  font-weight: 600;
  font-size: 3.2rem !important;
  letter-spacing: 0;
}

/* Dot styling for login page header (matches product page accent color) */
.login #site-name .site-name__dot {
  color: #c6a45b;
  display: inline;
  font-size: 1.1em;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif !important;
}

/* Override Django's default margin: 0 on login header h1 */
/* Preserve the desired margin-inline-end (end margin) for centering, prevent wrapping */
.login #header h1 {
  margin-inline-end: 0px !important;
  white-space: nowrap;}
  

/* ===== FORM CONTAINER & LAYOUT ===== */


@media (max-width: 767px) {
  body.login {
        margin-top: 15px !important;
  }

    .login #content {
        padding: 25px !important; 
    }

}

/* Login form container with rounded corners */
.login #container {
  border-radius: 22px !important;
  overflow: hidden;
  width: 28em;
  min-width: 0px; /* prevent overflow on small screens */
}

@media (min-width: 769px) {
  .login #container {
    border: 1px solid #efe7df;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  }
}

@media (min-width: 769px) {
  html[data-theme="dark"] .login #container {
    border: none;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

@media (min-width: 769px) and (prefers-color-scheme: dark) {
  html[data-theme="auto"] .login #container {
    border: none;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

/* Main content area */
#content-main {
  max-width: 420px;
  margin: 30px auto;
  font-family: 'DM Sans', 'Segoe UI', Tahoma, sans-serif !important;
}

/* Form rows spacing */
.form-row {
  margin-bottom: 14px;
}

/* Icon input wrapper */
.input-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon styling */
.input-with-icon .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #e4e4e8;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

/* Email icon - customizable background */
.input-with-icon .email-icon {
  background: #f0e8dc; /* Light blue */
}

/* Password icon - customizable background */
.input-with-icon .pass-icon {
  background: #f0e8dc; /* Light pink/red */
}

.input-with-icon .icon svg {
  display: block;
}

/* Input field styling */
.input-with-icon input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #dcdce1;
  border-radius: 6px;
  background: #fff;
  color: #000; /* Always black text for readability */
  font-family: 'Special Elite', 'Courier New', Courier, monospace;
  font-size: 0.95rem;
}


/* ===== TYPOGRAPHY & FONTS ===== */

/* Welcome message */
.login-welcome h1,
.login-welcome p {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 1.8em;
}

body.login #content h1,
body.login #content-main h1 {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif !important;
  font-weight: 500;
  font-size: 1.9em;
}

/* Login card paragraphs */
body.login #content p {
  font-family: 'DM Sans', 'Segoe UI', Tahoma, sans-serif !important;
  font-size: 0.87rem;
}

/* Form labels (Special Elite) */
#login-form label,
.form-row.input-icon label {
  font-size: 1.08em;
  letter-spacing: 0.01em;
  margin-bottom: 1px;
  margin-top: 10px;
}

.input-icon label {
  display: block;
  margin-bottom: 6px;
  color: #2c2c2c; /* Dark color for light mode */
  font-weight: 600;
}

/* Dark mode label styling */
html[data-theme="dark"] .input-icon label {
  color: #fafafa;
}

/* Auto mode - respect system preference */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .input-icon label {
    color: #fafafa;
  }
}

/* ===== BUTTONS & LINKS ===== */

/* Login buttons - consistent styling */
.submit-row input[type="submit"],
.submit-row a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #198385;
  color: #fff !important;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif !important;
  font-size: 1.3em;
  letter-spacing: 0.2px;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(231, 76, 60, 0.25);
  font-weight: 600;
  text-transform: none !important;
  text-decoration: none;
}

.submit-row input[type="submit"]:hover,
.submit-row input[type="submit"]:focus,
.submit-row a.button:hover {
  background-color: #126768;
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(207, 62, 48, 0.25);
}

/* Password reset link */
.password-reset-link {
  margin-top: 20px;
  text-align: center;
}

.password-reset-link a {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 1.37em;
  letter-spacing: 0.01em;
  color: #b07b2b;
  text-decoration: none;
  font-weight: 600;
}

.password-reset-link a:hover {
  text-decoration: none;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  /* Full screen layout for mobile - No margin/card effect */
  body.login {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Remove logo/title gap when stacked on small screens */
  body.login #site-branding {
    gap: 0 !important;
  }

  .login #container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 100vh;
  }

  #content-main {
    width: 100%;
    margin: 0 auto;
    padding: 0px 0px 15px 0px;
    max-width: none !important;
  }

  /* Logo padding only when stacked on small screens */
  body.login #site-branding .org-logo {
    padding-left: 24px;
  }
  
  .login #content {
    padding: 20px !important;
  }

  .submit-row input[type="submit"] {
    text-transform: none !important;
  }
}

/* ===== VERTICAL CENTERING (Login) ===== */
/* Center the entire login card vertically with balanced top/bottom gap */
body.login {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
  background: transparent;
  padding-bottom: 20px;
}

body.login::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, #f5ebde 0%, #f3f5f7 100%);
}

body.login #container {
  margin: 0;
}

/* Dark mode background */
html[data-theme="dark"] body.login {
  background: transparent;
}

html[data-theme="dark"] body.login::before {
  background: linear-gradient(160deg, #1b1b1b 0%, #252728 100%);
}

/* Auto mode - respect system preference */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] body.login {
    background: transparent;
  }

  html[data-theme="auto"] body.login::before {
    background: linear-gradient(160deg, #1b1b1b 0%, #252728 100%);
  }
}

/* ===== SIGNUP CARD ===== */

body.login.signup #content-main {
  max-width: 620px;
}

body.login.signup #container {
  width: 35em;
}

.login.signup .signup-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.login.signup .field-span-2 {
  grid-column: 1 / -1;
}

.login.signup .password-help-row {
  margin-top: -8px;
}

.login.signup .password-help-row .field-help {
  margin-top: 0;
}

.login.signup .signup-field label {
  display: block;
  margin-bottom: 6px;
  color: #2c2c2c;
  font-weight: 600;
}

.login.signup .signup-field input[type="text"],
.login.signup .signup-field input[type="email"],
.login.signup .signup-field input[type="password"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #dcdce1;
  border-radius: 6px;
  background: #fff;
  color: #000;
  font-family: 'Special Elite', 'Courier New', Courier, monospace;
  font-size: 0.95rem;
}

.login.signup .signup-field input:focus {
  outline: 2px solid rgba(25, 131, 133, 0.18);
  border-color: #198385;
}

.login.signup .field-help,
.login.signup .legal-links {
  margin: 6px 0 0;
  color: #6b6b6b;
  font-family: 'DM Sans', 'Segoe UI', Tahoma, sans-serif !important;
  font-size: 0.82rem;
  line-height: 1.45;
}

.login.signup .field-errors ul {
  margin: 6px 0 0;
  padding-left: 0;
  color: #b42318;
  font-family: 'DM Sans', 'Segoe UI', Tahoma, sans-serif !important;
  font-size: 0.82rem;
  list-style: none;
}

.login.signup .field-errors li {
  margin-left: 0;
  list-style: none;
}

.login.signup .slug-field {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: auto;
  max-width: 100%;
}

.login.signup .help-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  vertical-align: middle;
}

.login.signup .help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #198385;
  color: #fff;
  font-family: 'DM Sans', 'Segoe UI', Tahoma, sans-serif !important;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.login.signup .help-tooltip-wrap::after {
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  margin-top: 0;
  width: 270px;
  max-width: min(270px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
  text-transform: none;
  white-space: normal;
  z-index: 2000;
}

.login.signup .slug-field input {
  flex: 0 1 10rem;
  min-width: 0;
}

.login.signup .slug-suffix {
  color: #5c392e;
  font-family: 'Special Elite', 'Courier New', Courier, monospace;
  font-size: 1.0rem;
  margin-left: 6px;
  white-space: nowrap;
}

.login.signup .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
}

.login.signup .checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  margin-right: 8px;
}

.login.signup .checkbox-row span {
  font-family: 'DM Sans', 'Segoe UI', Tahoma, sans-serif !important;
  font-size: 0.9rem;
  line-height: 1.5;
}

.login.signup .checkbox-copy a {
  color: #b07b2b;
  text-decoration: none;
}

.login.signup .checkbox-copy a:hover {
  text-decoration: underline;
}

.login.signup .legal-links a {
  color: #b07b2b;
  text-decoration: none;
}

.login.signup .legal-links a:hover {
  text-decoration: underline;
}

.login.signup .signup-actions {
  margin-top: 20px;
  text-align: center;
}

.login.signup .honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

html[data-theme="dark"] .login.signup .signup-field label,
html[data-theme="dark"] .login.signup .slug-suffix,
html[data-theme="dark"] .login.signup .checkbox-row span {
  color: #fafafa;
}

html[data-theme="dark"] .login.signup .help-tooltip {
  background: #b07b2b;
  color: #111;
}

html[data-theme="dark"] .login.signup .signup-field input[type="text"],
html[data-theme="dark"] .login.signup .signup-field input[type="email"],
html[data-theme="dark"] .login.signup .signup-field input[type="password"] {
  background: #1f2122;
  border-color: #43494a;
  color: #fafafa;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .login.signup .signup-field label,
  html[data-theme="auto"] .login.signup .slug-suffix,
  html[data-theme="auto"] .login.signup .checkbox-row span {
    color: #fafafa;
  }

  html[data-theme="auto"] .login.signup .help-tooltip {
    background: #b07b2b;
    color: #111;
  }

  html[data-theme="auto"] .login.signup .signup-field input[type="text"],
  html[data-theme="auto"] .login.signup .signup-field input[type="email"],
  html[data-theme="auto"] .login.signup .signup-field input[type="password"] {
    background: #1f2122;
    border-color: #43494a;
    color: #fafafa;
  }
}

@media (max-width: 640px) {
  .login.signup .signup-form-grid {
    grid-template-columns: 1fr;
  }

  .login.signup .field-span-2 {
    grid-column: auto;
  }

  .login.signup .slug-field {
    row-gap: 4px;
  }

  .login.signup .help-tooltip-wrap::after {
    right: auto;
    left: 0;
    width: min(240px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
  }
}