@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

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

:root {
  --bg:           #080c17;
  --bg-card:      #0e1525;
  --border:       #1e2d45;
  --teal:         #00c2d4;
  --teal-dark:    #0097a7;
  --gold:         #c9a84c;
  --gold-light:   #e4c068;
  --text:         #e2e8f0;
  --text-muted:   #8899aa;
  --input-bg:     #111c2e;
  --input-border: #1e3048;
  --error:        #f87171;
  --success:      #4ade80;
  --warning:      #fbbf24;
}

html, body {
  height: 100%;
  background-color: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 194, 212, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(201, 168, 76, 0.05) 0%, transparent 60%);
}

/* ── Card ── */
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(0, 194, 212, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.5);
}

/* ── Header ── */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.login-logo {
  width: 72px;
  height: 72px;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  text-align: center;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-align: center;
}

/* ── Alert messages ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.alert-error   { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.25); color: var(--error); }
.alert-success { background: rgba(74, 222, 128, 0.1);  border: 1px solid rgba(74, 222, 128, 0.25);  color: var(--success); }
.alert-warning { background: rgba(251, 191, 36, 0.1);  border: 1px solid rgba(251, 191, 36, 0.25);  color: var(--warning); }
.alert-info    { background: rgba(0, 194, 212, 0.1);   border: 1px solid rgba(0, 194, 212, 0.2);    color: var(--teal); }

/* ── Form ── */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 194, 212, 0.12);
}

.form-control::placeholder {
  color: #3a4f66;
}

.form-control:autofill,
.form-control:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  -webkit-text-fill-color: var(--text);
}

/* ── Password row ── */
.password-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.forgot-link {
  font-size: 0.78rem;
  color: var(--gold);
  text-decoration: none;
  transition: color 0.15s;
}

.forgot-link:hover {
  color: var(--gold-light);
}

/* ── Remember me ── */
.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  cursor: pointer;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.remember-me input[type="checkbox"]:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.remember-me input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #080c17;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.remember-me span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Button ── */
.btn-primary {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  border: none;
  border-radius: 8px;
  color: #080c17;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover  { opacity: 0.9; }
.btn-primary:active { transform: scale(0.99); }

/* ── Terms checkbox (inline in registration) ── */
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem;
  margin-bottom: 1.25rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.terms-checkbox input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  background: var(--bg-card);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.terms-checkbox input[type="checkbox"]:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.terms-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #080c17;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.terms-checkbox span {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.terms-checkbox span a {
  color: var(--teal);
}

/* ── Wide card variant (terms) ── */
.login-card-wide {
  max-width: 560px;
}

/* ── Terms body ── */
.terms-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}

.terms-body p       { margin: 0 0 0.75rem; }
.terms-body p:last-child { margin-bottom: 0; }
.terms-body h2,
.terms-body h3      { margin: 1rem 0 0.5rem; color: var(--teal); font-size: 0.95rem; }
.terms-body a       { color: var(--teal); }

.terms-body::-webkit-scrollbar       { width: 8px; }
.terms-body::-webkit-scrollbar-track { background: transparent; }
.terms-body::-webkit-scrollbar-thumb { background: var(--input-border); border-radius: 4px; }

/* ── Consent list ── */
.consent-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  overflow: hidden;
}

.consent-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--input-border);
}

.consent-list li:last-child {
  border-bottom: none;
}

.consent-icon {
  color: var(--teal);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Form rows (side-by-side fields) ── */
.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-group-half {
  flex: 1;
}

/* ── Secondary button + form actions ── */
.form-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
}

.form-actions .btn-primary {
  flex: 1;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.1rem;
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--text);
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

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

/* ── Register ── */
.register-row {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.register-row a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.register-row a:hover {
  color: #33d1e0;
}

/* ── Social / Identity providers ── */
.social-providers {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.btn-social:hover {
  border-color: var(--teal);
  background: #131f33;
}

/* ── Locale switcher ── */
.locale-switcher {
  text-align: center;
  margin-top: 1.5rem;
}

.locale-switcher select {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.locale-switcher select option {
  background: var(--bg-card);
  color: var(--text);
}

/* ── Authenticator selector ── */
.authenticator-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.authenticator-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.authenticator-item:hover {
  border-color: var(--teal);
  background: var(--bg-card);
}

.authenticator-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 1.1rem;
}

.authenticator-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.authenticator-name {
  font-size: 0.95rem;
  color: var(--text);
}

.authenticator-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}
