:root {
  --bg:       #f8fafc;
  --surface:  #ffffff;
  --surface2: #f1f5f9;
  --primary:  #0d9488;
  --primary-d:#0f766e;
  --text:     #0f172a;
  --muted:    #64748b;
  --border:   rgba(15,23,42,0.08);
  --border-p: rgba(13,148,136,0.25);
  --danger:   #ef4444;
  --success:  #10b981;
  --r:        10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(13,148,136,0.08) 0%, transparent 60%);
}
a { text-decoration: none; color: inherit; }

/* ── TOP BRAND ── */
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: .95rem; color: var(--text);
  padding: 28px 0 0;
  flex-shrink: 0;
}
.auth-brand .mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff;
}

/* ── AUTH SHELL ── */
.auth-shell {
  flex: 1; width: 100%; display: flex;
  align-items: center; justify-content: center;
  padding: 24px 16px 40px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 40px rgba(15,23,42,0.08);
}
.auth-card.wide { max-width: 520px; }

/* ── AUTH HEADER ── */
.auth-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(13,148,136,0.12); border: 1px solid rgba(13,148,136,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.15rem;
  margin-bottom: 16px;
}
.auth-title { font-size: 1.3rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub   { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ── FORM CONTROLS ── */
.form-label {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 6px; display: block;
}
.form-label-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.form-label-row .form-label { margin-bottom: 0; }
.form-label-row a { font-size: 12px; color: var(--primary); }
.form-label-row a:hover { color: var(--primary-d); }

.form-control, .form-control-lg {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--r) !important;
  font-size: 14px !important;
  padding: 10px 14px !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  font-family: inherit !important;
}
.form-control:focus, .form-control-lg:focus {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(13,148,136,0.12) !important;
  color: var(--text) !important;
  outline: none !important;
}
.form-control::placeholder { color: rgba(100,116,139,0.7) !important; }
.form-control.is-invalid { border-color: var(--danger) !important; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important; }
.invalid-feedback { font-size: 12px; color: var(--danger); margin-top: 5px; display: block; }

.input-group { position: relative; }
.input-group-text {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-right: none !important;
  color: var(--muted) !important;
  border-radius: var(--r) 0 0 var(--r) !important;
  padding: 10px 12px !important;
}
.input-group .form-control {
  border-left: none !important;
  border-radius: 0 var(--r) var(--r) 0 !important;
}
.input-group .form-control:focus { border-left: none !important; }
.input-group .btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-left: none; color: var(--muted);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 0 14px;
  transition: color 0.15s;
}
.input-group .btn:hover { color: var(--text); background: var(--surface2); }

/* ── ALERT ── */
.auth-alert {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.22);
  border-radius: var(--r); padding: 12px 16px;
  color: #b91c1c; font-size: 13px; margin-bottom: 16px;
}
.auth-alert-success {
  background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.25);
  color: #047857;
}

/* ── CHECKBOX ── */
.form-check-input {
  background-color: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  width: 15px; height: 15px;
}
.form-check-input:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}
.form-check-label { font-size: 13px; color: var(--muted); }
.form-check-label a { color: var(--primary); }

/* ── PASSWORD STRENGTH ── */
.pw-meter {
  height: 3px; background: rgba(15,23,42,0.08);
  border-radius: 100px; margin-top: 8px; overflow: hidden;
}
.pw-meter div { height: 100%; width: 0; border-radius: 100px; transition: width .3s, background .3s; }
.pw-criteria { list-style: none; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.pw-criteria li {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
  background: rgba(15,23,42,0.05); border-radius: 5px; padding: 3px 8px;
  transition: color .2s, background .2s;
}
.pw-criteria li.ok, .pw-criteria li.valid { color: var(--success); background: rgba(16,185,129,0.10); }
.pw-criteria li.valid i { color: var(--success); }
#pwBar.pw-weak   { background: #ef4444; }
#pwBar.pw-medium { background: #f59e0b; }
#pwBar.pw-good   { background: #2563eb; }
#pwBar.pw-strong { background: var(--success); }
.caps-hint { display: none; font-size: 12px; color: #b45309; margin-top: 5px; }
.caps-hint.active { display: block; }

/* ── SUBMIT BUTTON ── */
.btn-auth {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: var(--primary); color: #fff;
  border: none; border-radius: var(--r);
  padding: 12px; font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn-auth:hover { background: var(--primary-d); transform: translateY(-1px); color: #fff; }
.btn-auth:active { transform: none; }

.btn-auth-outline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: transparent;
  border: 1px solid var(--border-p); color: var(--primary);
  border-radius: var(--r); padding: 11px;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-auth-outline:hover { background: rgba(13,148,136,0.08); color: var(--primary-d); }

/* ── DIVIDER ── */
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-divider span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── FOOTER LINK ── */
.auth-foot {
  padding: 20px 0 28px;
  font-size: 13px; color: var(--muted); text-align: center;
}
.auth-foot a { color: var(--primary); font-weight: 600; }
.auth-foot a:hover { color: var(--primary-d); }

/* ── SHAKE ── */
@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; }

/* ── RESPONSIVE ── */
@media(max-width:480px){
  .auth-card { padding: 24px 20px; }
}
