.signin-body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, sans-serif;
  background: radial-gradient(circle at top left, #2b3555, #0f1528 55%, #090e1c);
  color: #f3f6ff;
}

.signin-shell {
  width: min(980px, 94vw);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: center;
}

.signin-brand {
  padding: 12px;
}

.signin-brand-logo {
  width: 72px;
  height: 72px;
}

.signin-brand h1 {
  margin: 18px 0 10px;
  font-size: clamp(1.5rem, 2vw, 2rem);
  letter-spacing: 0.04em;
}

.signin-brand p {
  margin: 0;
  color: #c7d2ff;
  max-width: 36ch;
}

.signin-card {
  background: rgba(10, 15, 30, 0.92);
  border: 1px solid rgba(120, 140, 200, 0.35);
  border-radius: 16px;
  padding: 26px 24px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.signin-card h2 {
  margin: 0 0 6px;
}

.signin-subtitle {
  margin: 0 0 16px;
  color: #b9c6ef;
}

.signin-form {
  display: grid;
  gap: 10px;
}

.signin-form label {
  font-size: 0.9rem;
  color: #d4ddf8;
}

.signin-form input {
  border: 1px solid #3d4e80;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f5f7ff;
  color: #0d1340;
}

.signin-form input:focus {
  outline: 2px solid #7f9dff;
  outline-offset: 0;
}

/* Override browser autofill highlight to keep the white background */
.signin-form input:-webkit-autofill,
.signin-form input:-webkit-autofill:hover,
.signin-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #f5f7ff inset;
  -webkit-text-fill-color: #0d1340;
  transition: background-color 9999s ease-in-out 0s;
}

/* Give the password input right padding so the eye button never overlaps the dots */
.pw-field-wrap input {
  padding-right: 44px;
  width: 100%;
  box-sizing: border-box;
}

.btn-signin {
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  background: #3f67f2;
  color: #fff;
  font-weight: 700;
}

.btn-signin:disabled {
  opacity: 0.7;
  cursor: wait;
}

.signin-error {
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 105, 135, 0.6);
  background: rgba(136, 30, 62, 0.45);
  color: #ffd4df;
  padding: 9px 10px;
  font-size: 0.9rem;
}

/* Password visibility toggle */
.pw-field-wrap {
  position: relative;
}

.pw-field-wrap .auth-input {
  padding-right: 44px;
}

.pw-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #3f67f2;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 1;
  transition: color 0.15s;
}

.pw-toggle-btn:hover {
  color: #3f67f2
}

/* Eye toggle PNG icons — dark/light theme swap */
.pw-toggle-btn img.eye-open,
.pw-toggle-btn img.eye-closed { display: none; }

[data-theme="light"] .pw-toggle-btn img.eye-light,
html:not([data-theme]) .pw-toggle-btn img.eye-light { display: block; }
[data-theme="dark"]   .pw-toggle-btn img.eye-dark   { display: block; }

.pw-toggle-btn img[hidden] { display: none !important; }

#passwordInput {
  width: 100%;
}
@media (max-width: 840px) {
  .signin-shell {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 20px 0;
  }
}

/* ─── Forgot Password Link ──────────────────────────────────────────── */
.forgot-password-link {
  display: block;
  width: 100%;
  padding: 8px 0;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.forgot-password-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ─── Forgot Password Modal ─────────────────────────────────────────── */
.signin-modal-content {
  max-width: 420px;
}

.forgot-password-error,
.forgot-password-success {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}

.forgot-password-error {
  background-color: var(--error-bg, #fee);
  border: 1px solid var(--error, #c33);
  color: var(--error, #c33);
}

.forgot-password-success {
  background-color: var(--success-bg, #efe);
  border: 1px solid var(--success, #3a3);
  color: var(--success, #3a3);
}

.modal-info {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Forgot password modal on dark signin page */
.signin-body .modal-content {
  background: rgba(10, 15, 30, 0.98);
  border: 1px solid rgba(120, 140, 200, 0.35);
  color: #f3f6ff;
}

.signin-body .modal-header {
  border-bottom-color: rgba(120, 140, 200, 0.35);
}

.signin-body .modal-header h3 {
  color: #f3f6ff;
}

.signin-body .modal-body label {
  color: #d4ddf8;
}

.signin-body .modal-body input[type="text"] {
  border: 1px solid #3d4e80;
  background: #f5f7ff;
  color: #0d1340;
}

.signin-body .modal-info {
  color: #b9c6ef;
}

.signin-body .modal-close {
  color: #b9c6ef;
}

/* ─── Sign-in mobile (Phase 34) ───────────────────────────────── */
@media (max-width: 768px) {
  .signin-shell {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }

  .signin-brand {
    text-align: center;
  }

  .signin-card {
    width: 100%;
    max-width: none;
  }

  .btn-signin,
  .forgot-password-link {
    min-height: 44px;
  }

  .signin-body .modal-content.signin-modal-content {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .signin-body .modal {
    padding: 0;
    align-items: stretch;
  }

  .signin-body .modal-content {
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}
