:root {
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --border: #e2e8f0;
  --text-muted: #64748b;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  height: 100vh;
  /* Swapped dark gradients for clean SaaS background */
  background: #f8fafc;
  color: #0f172a;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  /* Light glass header */
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1300px;
  margin: auto;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 900;
  font-size: 18px;
  color: #0f172a;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav a:hover {
  color: var(--blue);
}

.wrapper {
  height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 34px;
  /* Refined soft shadow for light mode */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  animation: enter 0.6s ease;
}

.card h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.card p {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 14px;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  padding: 14px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  /* Added border for white-on-white visibility */
  border: 1px solid var(--border);
}

.google-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.field {
  margin-bottom: 16px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  color: #0f172a;
  font-size: 14px;
}

.field input::placeholder {
  color: #94a3b8;
}

.field input:focus {
  outline: none;
  border-color: var(--blue);
  background: #ffffff;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color 0.2s;
  width: auto;
  margin-top: 0;
}

.password-toggle:hover {
  color: var(--blue);
  transform: translateY(-50%);
  box-shadow: none;
  background: none;
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

button {
  width: 100%;
  margin-top: 10px;
  padding: 16px;
  border-radius: 18px;
  border: none;
  background: var(--blue);
  color: white;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.footer {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.footer a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #f1f5f9;
  border-top-color: var(--blue);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
        .nav-logo-text {
            font-family: 'Outfit', sans-serif;
            font-size: 20px;
            font-weight: 700;
            color: var(--ink);
            letter-spacing: -0.3px;
        }

        .nav-logo-text span {
            color: var(--blue);
        }
        .password-strength {
          width: 100%;
          height: 6px;
          background: #e5e7eb;
          border-radius: 4px;
          margin-top: 6px;
          overflow: hidden;
        }
        
        .strength-bar {
          height: 100%;
          width: 0%;
          transition: all 0.3s ease;
          border-radius: 4px;
        }
        
        .strength-text {
          font-size: 12px;
          margin-top: 4px;
          font-weight: 500;
        }
        label {
          display: block;
          font-size: 13px;
          font-weight: 600;
          color: var(--ink-2);
          margin-bottom: 8px;
      }

      /* ── OTP ── */
      .otp-hint {
        font-size: 14px;
        color: var(--text-muted);
        margin-bottom: 20px;
        text-align: center;
      }
      .otp-boxes {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-bottom: 16px;
      }
      .otp-box {
        width: 46px;
        height: 54px;
        border-radius: 12px;
        border: 1.5px solid var(--border);
        background: #f1f5f9;
        font-size: 22px;
        font-weight: 700;
        text-align: center;
        color: #0f172a;
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s;
        caret-color: var(--blue);
      }
      .otp-box:focus {
        border-color: var(--blue);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
      }
      .otp-box.error {
        border-color: #ef4444;
        background: #fef2f2;
        box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
      }
      .otp-error {
        font-size: 13px;
        color: #ef4444;
        text-align: center;
        margin-bottom: 12px;
        font-weight: 500;
      }
      .otp-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 14px;
        margin-top: 4px;
        flex-wrap: wrap;
      }
      .otp-resend {
        width: auto;
        margin-top: 0;
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 600;
        background: none;
        color: var(--blue);
        border: 1.5px solid var(--blue);
        border-radius: 10px;
      }
      .otp-resend:hover { background: #eff6ff; transform: none; box-shadow: none; }
      .otp-resend:disabled { color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }
      .otp-countdown {
        font-size: 13px;
        color: var(--text-muted);
        font-weight: 500;
      }
      .otp-back {
        width: auto;
        margin-top: 0;
        padding: 8px 14px;
        font-size: 13px;
        font-weight: 600;
        background: none;
        color: var(--text-muted);
        border: none;
        box-shadow: none;
      }
      .otp-back:hover { background: none; color: #0f172a; transform: none; box-shadow: none; }

      @keyframes shake {
        0%,100% { transform: translateX(0); }
        20%      { transform: translateX(-6px); }
        40%      { transform: translateX(6px); }
        60%      { transform: translateX(-4px); }
        80%      { transform: translateX(4px); }
      }
      .shake { animation: shake 0.4s ease; }

      /* ── VALIDATION ── */
      .input-error {
        border-color: #ef4444 !important;
        background: #fef2f2 !important;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
      }

      .error-text {
        font-size: 12px;
        color: #ef4444;
        font-weight: 500;
        margin-top: 6px;
        display: block;
      }