/* ==========================================================================
   GenDiligence — Color Scheme Matched to https://www.gendiligence.com/
   ========================================================================== */

:root {
  /* Brand Exact Color Palette */
  --brand-navy: #072B53;          /* Deep Navy from the Wordmark & Headings */
  --brand-navy-hover: #0B3B70;
  --brand-navy-light: #0E427B;
  
  --brand-green: #00C48C;         /* Mint / Emerald Green from the Official Logo Icon */
  --brand-green-hover: #00B07D;
  --brand-green-subtle: rgba(0, 196, 140, 0.09);
  --brand-green-border: rgba(0, 196, 140, 0.28);

  --text-primary: #0A1E35;        /* Crisp High-Contrast Navy */
  --text-secondary: #334E68;      /* Mid Navy Slate */
  --text-muted: #475569;          /* Slate Grey */
  --text-subtle: #64748B;

  --border-light: #E2E8F0;
  --border-subtle: #CBD5E1;
  --border-focus: #05335A;
  --border-sharp: 1px solid rgba(7, 43, 83, 0.12);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 8px 24px -4px rgba(7, 43, 83, 0.08);
  --shadow-input-focus: 0 0 0 3.5px rgba(5, 51, 90, 0.18), 0 0 14px rgba(5, 51, 90, 0.22);

  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: var(--font-body);
  background-color: #FFFFFF;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.012em;
}

/* Clean White Canvas (Background image preserved in comment for later use) */
body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  background-color: #FFFFFF;
  padding: 32px 0;
}

/* Top Header */
.login-header {
  width: 100%;
  max-width: 100%;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-icon-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 196, 140, 0.7);
  animation: effect1RingPulse 2.4s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
  pointer-events: none;
}

.brand-icon-ring:nth-child(2) {
  animation-delay: 1.2s;
}

.brand-icon-img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 196, 140, 0.6));
  animation: effect1Float 3s ease-in-out infinite;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, filter;
  position: relative;
  z-index: 2;
}

.brand-logo:hover .brand-icon-img {
  transform: scale(1.15) translateY(-3px);
  filter: drop-shadow(0 0 22px rgba(0, 196, 140, 0.9));
}

@keyframes effect1Float {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 8px rgba(0, 196, 140, 0.5)); }
  50% { transform: translateY(-4px) scale(1.05); filter: drop-shadow(0 0 20px rgba(0, 196, 140, 0.85)); }
}

@keyframes effect1RingPulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.brand-name-text {
  font-family: 'Newsreader', 'Instrument Serif', 'Georgia', serif;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--brand-navy);
  letter-spacing: -0.015em;
}

.header-cta-link {
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
}

.header-cta-link:hover {
  color: var(--brand-navy);
}

.header-cta-link strong {
  color: var(--brand-green);
  font-weight: 700;
}

.header-cta-link:hover strong {
  color: var(--brand-green-hover);
  text-decoration: underline;
}

/* Center Form Card */
.login-card-container {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
}

.login-card {
  background-color: #ddf6ea;
  border: 2px solid #00F0A8;
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: 
    0 0 0 1px #00F0A8,
    0 0 16px rgba(0, 240, 168, 0.45),
    0 0 32px rgba(0, 240, 168, 0.25),
    0 12px 36px -4px rgba(0, 196, 140, 0.3),
    0 24px 60px -12px rgba(7, 43, 83, 0.14);
  position: relative;
  transition: all var(--transition-normal);
}

.login-card:hover {
  border-color: #00FFB2;
  box-shadow: 
    0 0 0 1.5px #00FFB2,
    0 0 26px rgba(0, 255, 178, 0.8),
    0 0 52px rgba(0, 255, 178, 0.5),
    0 0 85px rgba(0, 255, 178, 0.3),
    0 24px 64px -8px rgba(7, 43, 83, 0.22);
  transform: translateY(-2px);
}

.login-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-navy);
  margin-bottom: 0;
  min-height: 2.6rem;
  display: inline-block;
}

.card-title.typing-title::after {
  content: '';
  display: inline-block;
  width: 2.5px;
  height: 1.8rem;
  background-color: var(--brand-navy);
  margin-left: 4px;
  vertical-align: -2px;
  animation: cursorBlink 0.75s infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Inputs & Form Groups */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 1.1rem;
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  background: #FFFFFF;
  border: 1.5px solid rgba(5, 51, 90, 0.22);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--brand-navy);
  transition: all var(--transition-fast);
}

/* Add left padding ONLY when input-icon is present */
.input-icon ~ .form-control,
.input-wrap.has-icon .form-control {
  padding-left: 42px !important;
}

/* Enforce symmetrical padding & text centering for centered inputs */
.form-control.text-center,
.form-control.input-center,
.form-control.code-input-centered,
.input-wrap-no-icon .form-control {
  padding-left: 16px !important;
  padding-right: 16px !important;
  text-align: center !important;
}

.form-control:focus {
  outline: none;
  border-color: #05335A;
  box-shadow: 0 0 0 3.5px rgba(5, 51, 90, 0.18), 0 0 14px rgba(5, 51, 90, 0.22);
  background-color: #FFFFFF;
}

.input-wrap:focus-within .input-icon {
  color: #05335A;
}

.form-control::placeholder {
  color: var(--text-subtle);
}

/* OTP Digit Inputs */
.otp-inputs-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 18px;
}

.otp-digit {
  width: 46px;
  height: 52px;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-navy);
  border: 1.5px solid rgba(5, 51, 90, 0.22);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  transition: all var(--transition-fast);
}

.otp-digit:focus {
  outline: none;
  border-color: #05335A;
  box-shadow: 0 0 0 3.5px rgba(5, 51, 90, 0.18), 0 0 14px rgba(5, 51, 90, 0.22);
}

/* Primary Action Button (Brand Navy) */
.btn-continue {
  width: 100%;
  padding: 14px 20px;
  background: var(--brand-navy);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(7, 43, 83, 0.18);
}

.btn-continue:hover {
  background: var(--brand-navy-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(7, 43, 83, 0.24);
}

.btn-continue:active {
  transform: translateY(0);
}

/* Legal Terms Notice (Exact text from app.gendiligence.com) */
.login-legal-notice {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
}

.login-legal-notice a {
  color: var(--text-secondary);
  text-decoration: underline;
  font-weight: 500;
}

.login-legal-notice a:hover {
  color: var(--brand-green-hover);
}

/* Bottom Footer */
.login-footer {
  width: 100%;
  max-width: 100%;
  padding: 0 48px;
  margin-top: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-subtle);
  text-align: center;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
}

.toast {
  background: var(--brand-navy);
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(7, 43, 83, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(7, 43, 83, 0.05);
  border: 1px solid rgba(7, 43, 83, 0.12);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: rgba(7, 43, 83, 0.1);
  transform: translateY(-1px);
}

.theme-toggle-btn i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Dark Mode Support [data-theme="dark"]
   ========================================================================== */
[data-theme="dark"] {
  --border-light: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] body {
  background-color: #070D1D;
  color: #F8FAFC;
}

[data-theme="dark"] .brand-name-text {
  color: #FFFFFF;
}

/* Keep the card box in its custom light mint #ddf6ea with dark text */
[data-theme="dark"] .login-card {
  background-color: #ddf6ea;
  border-color: rgba(0, 196, 140, 0.35);
  box-shadow: 
    0 8px 16px -2px rgba(0, 0, 0, 0.5),
    0 24px 48px -12px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .card-title {
  color: #072B53;
}

[data-theme="dark"] .card-title.typing-title::after {
  background-color: #072B53;
}

[data-theme="dark"] .form-label {
  color: #072B53;
}

[data-theme="dark"] .form-control {
  background-color: #FFFFFF;
  border-color: rgba(5, 51, 90, 0.22);
  color: #072B53;
}

[data-theme="dark"] .form-control:focus {
  border-color: #05335A;
  box-shadow: 0 0 0 3.5px rgba(5, 51, 90, 0.18), 0 0 14px rgba(5, 51, 90, 0.22);
  background-color: #FFFFFF;
}

[data-theme="dark"] .input-wrap:focus-within .input-icon {
  color: #05335A;
}

[data-theme="dark"] .login-card {
  background-color: #ddf6ea !important;
  border: 2px solid #FFFFFF !important;
  box-shadow: 
    0 0 0 1px #FFFFFF,
    0 0 20px rgba(255, 255, 255, 0.85),
    0 0 40px rgba(255, 255, 255, 0.5),
    0 0 70px rgba(255, 255, 255, 0.3),
    0 24px 60px rgba(0, 0, 0, 0.6) !important;
  transition: all var(--transition-normal);
}

[data-theme="dark"] .login-card:hover {
  border-color: #FFFFFF !important;
  box-shadow: 
    0 0 0 1.5px #FFFFFF,
    0 0 28px rgba(255, 255, 255, 0.95),
    0 0 56px rgba(255, 255, 255, 0.7),
    0 0 90px rgba(255, 255, 255, 0.45),
    0 32px 70px rgba(0, 0, 0, 0.7) !important;
  transform: translateY(-2px);
}

[data-theme="dark"] .otp-digit {
  background-color: #FFFFFF;
  border-color: rgba(5, 51, 90, 0.22);
  color: #072B53;
}

[data-theme="dark"] .otp-digit:focus {
  border-color: #05335A;
  box-shadow: 0 0 0 3.5px rgba(5, 51, 90, 0.18), 0 0 14px rgba(5, 51, 90, 0.22);
}

[data-theme="dark"] .login-footer-disclaimer,
[data-theme="dark"] .disclaimer-text {
  color: #334E68;
}

[data-theme="dark"] .disclaimer-text a {
  color: #072B53;
  font-weight: 700;
}

[data-theme="dark"] .btn-continue {
  background: #072B53;
  color: #FFFFFF;
  font-weight: 700;
}

[data-theme="dark"] .btn-continue:hover {
  background: #0B3B70;
}

[data-theme="dark"] .header-cta-link {
  color: #CBD5E1;
}

[data-theme="dark"] .header-cta-link:hover {
  color: #FFFFFF;
}

[data-theme="dark"] .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #F8FAFC;
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .login-footer {
  color: #94A3B8;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: 24px 16px;
  }
  .login-card {
    padding: 32px 24px;
  }
  .otp-digit {
    width: 38px;
    height: 46px;
    font-size: 1.2rem;
  }
}
