/* /css/styles.css */
:root {
  --accent:        #940000;
  --accent-hover:  #6e0000;
  --accent-subtle: rgba(148, 0, 0, 0.08);
}

* {
  font-family: 'Public Sans', sans-serif;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Screen-reader only ───────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Text selection ───────────────────────────────────────────────────────── */
::selection {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ── Page fade-in ─────────────────────────────────────────────────────────── */
.login-wrap {
  animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ── Loading overlay ──────────────────────────────────────────────────────── */
/* Always display:flex — opacity + visibility handle show/hide so transitions work */
.loading-overlay {
  position:     fixed;
  inset:        0;
  background:   rgba(255, 255, 255, 0.97);
  display:      flex;
  justify-content: center;
  align-items:  center;
  z-index:      9999;
  opacity:      0;
  visibility:   hidden;
  transition:   opacity 0.25s ease, visibility 0.25s ease;
}

.loading-overlay.active {
  opacity:    1;
  visibility: visible;
}

.loading-spinner {
  width:  48px;
  height: 48px;
  border: 4px solid var(--accent-subtle);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Inputs ───────────────────────────────────────────────────────────────── */
.input {
  border-color: #d1d5db !important;
  background:   #fff    !important;
  color:        #111    !important;
  transition:   border-color 0.15s, box-shadow 0.15s;
}

.input:hover {
  border-color: #9ca3af !important;
}

.input:focus {
  outline:      none            !important;
  border-color: var(--accent)   !important;
  box-shadow:   0 0 0 3px var(--accent-subtle) !important;
}

.input:focus-visible {
  outline:        2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Input icon wrapper ───────────────────────────────────────────────────── */
.input-icon-wrap {
  position: relative;
}

.input-icon {
  position:       absolute;
  left:           13px;
  top:            50%;
  transform:      translateY(-50%);
  color:          #9ca3af;
  pointer-events: none;
}

.input-with-icon {
  padding-left: 2.5rem !important;
}

/* Room for the eye toggle on the right */
.input-with-toggle {
  padding-right: 2.75rem !important;
}

/* ── Password visibility toggle button ───────────────────────────────────── */
.input-toggle {
  position:    absolute;
  right:       11px;
  top:         50%;
  transform:   translateY(-50%);
  background:  none;
  border:      none;
  cursor:      pointer;
  color:       #9ca3af;
  padding:     4px;
  display:     flex;
  align-items: center;
  border-radius: 4px;
  transition:  color 0.15s;
  line-height: 1;
}

.input-toggle:hover {
  color: #374151;
}

.input-toggle:focus-visible {
  outline:        2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Primary button ───────────────────────────────────────────────────────── */
.btn-signin {
  background:      #111111;
  border:          none;
  color:           #fff;
  font-weight:     600;
  font-size:       0.9rem;
  letter-spacing:  0.01em;
  transition:      background 0.15s;
  cursor:          pointer;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
}

.btn-signin:hover  { background: var(--accent); color: #fff; }
.btn-signin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-signin:disabled { opacity: 0.6; cursor: not-allowed; background: #111111; }

/* ── Social buttons ───────────────────────────────────────────────────────── */
.btn-social {
  background:      #fff;
  border:          1px solid #d1d5db;
  color:           #111;
  font-weight:     500;
  font-size:       0.85rem;
  cursor:          pointer;
  transition:      border-color 0.15s, background 0.15s, color 0.15s;
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  width:           100%;
}

.btn-social:hover { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
.btn-social:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-social:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Links ────────────────────────────────────────────────────────────────── */
.accent-link {
  color:                  #111;
  font-weight:            600;
  text-decoration:        underline;
  text-underline-offset:  3px;
  text-decoration-color:  #ccc;
  transition:             color 0.15s, text-decoration-color 0.15s;
  cursor:                 pointer;
}

.accent-link:hover,
.accent-link:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.subtle-link {
  color:           #9ca3af;
  font-weight:     400;
  text-decoration: none;
  transition:      color 0.15s;
}

.subtle-link:hover,
.subtle-link:focus-visible { color: var(--accent); }

.forgot-link {
  font-size:       0.8rem;
  color:           #6b7280;
  font-weight:     500;
  text-decoration: none;
  transition:      color 0.15s;
  white-space:     nowrap;
}

.forgot-link:hover,
.forgot-link:focus-visible { color: var(--accent); }

/* ── Checkbox ─────────────────────────────────────────────────────────────── */
.checkbox { border-color: #d1d5db; transition: border-color 0.15s; }
.checkbox:hover            { border-color: var(--accent) !important; }
.checkbox:checked          { background-color: var(--accent) !important; border-color: var(--accent) !important; }

/* ── "or" divider ─────────────────────────────────────────────────────────── */
.or-divider {
  display:     flex;
  align-items: center;
  gap:         12px;
  margin:      24px 0;
}

.or-line {
  flex:       1;
  height:     1px;
  background: #e5e7eb;
}

.or-text {
  font-size:      0.75rem;
  color:          #9ca3af;
  font-weight:    500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Password strength indicator ──────────────────────────────────────────── */
.password-strength {
  display:     flex;
  align-items: center;
  gap:         8px;
  margin-top:  6px;
}

.strength-track {
  flex:         1;
  height:       4px;
  background:   #e5e7eb;
  border-radius: 2px;
  overflow:     hidden;
}

.strength-fill {
  height:       100%;
  border-radius: 2px;
  width:        0;
  transition:   width 0.3s ease, background-color 0.3s ease;
}

.strength-label {
  font-size:   0.75rem;
  font-weight: 600;
  color:       #6b7280;
  min-width:   42px;
  text-align:  right;
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.error-message {
  background-color: #fee2e2;
  border:           1px solid #ef4444;
  color:            #b91c1c;
  padding:          12px 16px;
  border-radius:    8px;
  font-size:        0.875rem;
  margin-bottom:    16px;
  display:          none;
  animation:        slideIn 0.2s ease;
}

.error-message.show   { display: block; }

.success-message {
  background-color: #dcfce7;
  border:           1px solid #22c55e;
  color:            #166534;
  padding:          12px 16px;
  border-radius:    8px;
  font-size:        0.875rem;
  margin-bottom:    16px;
  display:          none;
  animation:        slideIn 0.2s ease;
}

.success-message.show { display: block; }

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

/* ── Terms links ──────────────────────────────────────────────────────────── */
.terms-link {
  color:                  #374151;
  font-weight:            600;
  text-decoration:        underline;
  text-underline-offset:  2px;
  text-decoration-color:  #ccc;
  transition:             color 0.15s, text-decoration-color 0.15s;
}

.terms-link:hover,
.terms-link:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.page-footer {
  position:   fixed;
  bottom:     0;
  left:       0;
  width:      100%;
  text-align: center;
  padding:    14px 16px;
  font-size:  0.75rem;
  color:      #9ca3af;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-wrap {
    padding-left:  1rem;
    padding-right: 1rem;
    padding-top:   2rem;
    padding-bottom: 5rem; /* clear fixed footer */
  }

  .page-footer {
    font-size: 0.7rem;
    padding:   10px 12px;
  }
}

@media (max-height: 780px) {
  .page-footer {
    position: static;
    padding:  20px 16px 16px;
  }
}
