/* ============================================================
   Aniplay — auth.css  |  Registration, Login, Verify, Forms
   ============================================================ */

/* ── Auth layout ──────────────────────────────────────────── */
.auth-main {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.auth-container {
  width: 100%;
  max-width: 460px;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ── Auth header ──────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.75rem;
}
.auth-logo .logo-text { font-size: 1.1rem; font-weight: 700; color: var(--color-accent); }

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.auth-sub {
  font-size: 0.88rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}
.auth-sub strong,
.auth-sub .email-mask {
  color: var(--color-text);
  font-style: normal;
}

/* ── Form groups ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.125rem;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--color-raise);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text);
  font-size: 0.95rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder { color: var(--color-dim); }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}

.form-group input.field-invalid { border-color: #ff4444; }
.form-group input.field-valid   { border-color: #44cc88; }

/* ── Phone row: country code + number ────────────────────── */
.phone-row {
  display: flex;
  gap: 8px;
}

.country-select {
  flex: 0 0 110px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7A8D' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  padding-right: 28px;
  cursor: pointer;
}

.country-select option {
  background: var(--color-surface);
  color: var(--color-text);
}

.phone-row input[type="tel"] { flex: 1; }

/* ── Password wrapper with toggle ────────────────────────── */
.pass-wrap {
  position: relative;
}

.pass-wrap input { padding-right: 44px; }

.pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-dim);
  padding: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.2s;
}
.pass-toggle:hover { color: var(--color-muted); }
.pass-toggle svg { width: 18px; height: 18px; }

/* ── Password strength ────────────────────────────────────── */
.pass-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-height: 18px;
}

.strength-bar {
  flex: 1;
  height: 3px;
  background: var(--color-raise);
  border-radius: 3px;
  overflow: hidden;
}

#strength-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
}

#strength-label {
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 48px;
  text-align: right;
}

/* ── Field-level error messages ───────────────────────────── */
.field-error {
  display: block;
  font-size: 0.78rem;
  color: #ff5555;
  margin-top: 4px;
  min-height: 1em;
}

/* ── Remember row ─────────────────────────────────────────── */
.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-muted);
  cursor: pointer;
  margin-bottom: 1.25rem;
}
.remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
  cursor: pointer;
  margin: 0;
}

/* ── Forgot link ──────────────────────────────────────────── */
.forgot-link {
  font-size: 0.78rem;
  color: var(--color-accent);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.forgot-link:hover { text-decoration: underline; }

/* ── Form-level alert ─────────────────────────────────────── */
.form-alert {
  display: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.form-alert.visible { display: block; }
.form-alert--error   { background: rgba(255,60,60,0.08); border: 1px solid rgba(255,60,60,0.25); color: #ff6060; }
.form-alert--success { background: rgba(68,204,136,0.08); border: 1px solid rgba(68,204,136,0.25); color: #44cc88; }

/* ── Submit button states ─────────────────────────────────── */
#reg-submit,
#verify-submit,
#login-submit {
  margin-top: 0.25rem;
  padding: 13px 22px;
  font-size: 0.95rem;
}

.btn-loader { color: var(--color-muted); font-style: italic; }

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ── OTP grid ─────────────────────────────────────────────── */
.otp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 2rem 0 1.5rem;
}

.otp-sep {
  color: var(--color-dim);
  font-size: 1.2rem;
  margin: 0 4px;
}

.otp-box {
  width: 50px;
  height: 58px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: monospace;
  background: var(--color-raise);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--color-accent);
  -webkit-appearance: none;
  appearance: none;
}
.otp-box:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}
.otp-box.filled {
  border-color: rgba(255,107,53,0.4);
  background: rgba(255,107,53,0.06);
}
.otp-box.otp-error {
  border-color: #ff4444;
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-5px); }
  40%,80%  { transform: translateX(5px); }
}

/* ── Resend code row ──────────────────────────────────────── */
.resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 1.25rem;
  font-size: 0.85rem;
}

.resend-timer { color: var(--color-muted); }
.resend-timer strong { color: var(--color-text); }

/* ── Terms link ───────────────────────────────────────────── */
.auth-terms {
  font-size: 0.78rem;
  color: var(--color-dim);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.5;
}
.auth-terms a { color: var(--color-muted); }
.auth-terms a:hover { color: var(--color-text); }

/* ── Auth switch line ─────────────────────────────────────── */
.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}
.auth-switch a { color: var(--color-accent); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ── Mobile responsive ────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.25rem; border-radius: 20px; }
  .otp-box   { width: 42px; height: 50px; font-size: 1.25rem; border-radius: 10px; }
  .otp-sep   { display: none; }
  .country-select { flex: 0 0 90px; font-size: 0.82rem; padding-left: 8px; }
}
