/* ============================================================
   LOGIN / REGISTO — Young & Fresh
   ============================================================ */
:root {
  --primary: #2563eb;
  --primary-dk: #1e40af;
  --accent: #0891b2;
  --green: #059669;
  --pink: #ec4899;
  --orange: #f59e0b;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --surface: #ffffff;
  --gradient: linear-gradient(120deg, #2563eb 0%, #0891b2 50%, #059669 100%);
  --gradient-btn: linear-gradient(135deg, #2563eb 0%, #0891b2 60%, #059669 100%);
  --shadow-soft: 0 4px 20px rgba(37,99,235,.1);
  --shadow-strong: 0 16px 48px rgba(37,99,235,.2);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(60vh) rotate(720deg); opacity: 0; }
}
.animate-in { animation: fadeUp .5s ease both; }
.animate-in-delay { animation: fadeUp .5s ease .15s both; }
.animate-slide { animation: slideIn .4s ease both; }

/* ── Header ───────────────────────────────────────────── */
.auth-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.auth-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 12px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.auth-header-left {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}
.auth-header-logo { width: 44px; height: 44px; object-fit: contain; }
.auth-header-brand {
  font-size: 1.1rem; font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-header-back {
  font-size: .85rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--border);
  transition: all .2s;
}
.auth-header-back:hover { background: var(--bg); color: var(--text); }

/* ── Page layout ──────────────────────────────────────── */
.auth-page {
  max-width: 520px;
  margin: 40px auto;
  padding: 0 20px;
}
.auth-page-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.auth-page-sub {
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 28px;
}

/* ── Tabs ─────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: #eff6ff;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
}
.tab-link {
  flex: 1; text-align: center;
  padding: 12px 0;
  font-size: .93rem; font-weight: 700;
  border: none; background: transparent;
  color: var(--muted); border-radius: 12px;
  cursor: pointer; transition: all .25s;
}
.tab-link.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 12px rgba(37,99,235,.12);
}
.tab-link:hover:not(.active) { color: var(--primary); }

/* ── Card ─────────────────────────────────────────────── */
.auth-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 36px 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition: box-shadow .3s;
}
.auth-card:hover { box-shadow: var(--shadow-strong); }

.form-section { display: none; }
.form-section.active { display: block; animation: fadeUp .4s ease; }

.section-title { font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.section-sub { font-size: .88rem; color: var(--muted); margin-bottom: 24px; }

/* ── Stepper ──────────────────────────────────────────── */
.stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 28px;
}
.stepper-step {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700; color: var(--muted);
  transition: color .3s;
}
.stepper-step.active { color: var(--primary); }
.stepper-step.done { color: var(--green); }
.stepper-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #eff6ff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem;
  transition: all .3s;
  border: 2px solid transparent;
}
.stepper-step.active .stepper-dot {
  background: var(--gradient-btn); color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
}
.stepper-step.done .stepper-dot {
  background: var(--green); color: #fff;
}
.stepper-line {
  width: 32px; height: 2px;
  background: var(--border);
  margin: 0 6px;
  transition: background .3s;
}
.stepper-line.done { background: var(--green); }

.step-panel { display: none; }
.step-panel.active { display: block; animation: slideIn .35s ease; }
.step-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Form fields ──────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: .8rem; font-weight: 700;
  color: var(--muted); margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="tel"],
.field select {
  width: 100%; padding: 13px 16px;
  border: 2px solid var(--border); border-radius: 12px;
  font-size: .93rem; font-family: inherit;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
  transform: translateY(-1px);
}
.field input[type="file"] {
  width: 100%; padding: 16px;
  border: 2px dashed #93c5fd; border-radius: 12px;
  font-size: .88rem; background: #eff6ff; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.field input[type="file"]:hover { border-color: var(--primary); background: #dbeafe; }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 80px; }
.pw-toggle {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  font-size: .8rem; font-weight: 700;
  color: var(--primary); cursor: pointer;
}

/* ── Field errors ──────────────────────────────────────── */
.field.has-error input,
.field.has-error select {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.field.has-error label { color: #ef4444; }
.field-error {
  font-size: .8rem;
  color: #ef4444;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Options ──────────────────────────────────────────── */
.options-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.check-label {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .85rem; color: var(--muted); cursor: pointer; line-height: 1.4;
}
.check-label input[type="checkbox"] { margin-top: 2px; accent-color: var(--primary); cursor: pointer; }
.check-label a { color: var(--primary); text-decoration: none; font-weight: 600; }
.forgot-link { font-size: .85rem; color: var(--primary); text-decoration: none; font-weight: 600; }
.consents { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

/* ── Alerts ───────────────────────────────────────────── */
.alert-box { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .88rem; display: none; }
.alert-box.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-box.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── Buttons ──────────────────────────────────────────── */
.btn-submit {
  width: 100%; padding: 15px;
  background: var(--gradient-btn); color: #fff;
  border: none; border-radius: 14px;
  font-size: .95rem; font-weight: 800;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 24px rgba(37,99,235,.25);
  transition: transform .2s, box-shadow .2s;
}
.btn-submit:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 12px 36px rgba(37,99,235,.3); }
.btn-submit:active { transform: translateY(0) scale(.99); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-step {
  padding: 13px 28px;
  border: none; border-radius: 12px;
  font-size: .9rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: all .2s;
}
.btn-next { background: var(--gradient-btn); color: #fff; box-shadow: 0 4px 16px rgba(37,99,235,.2); }
.btn-next:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(37,99,235,.3); }
.btn-back { background: #eff6ff; color: var(--primary); }
.btn-back:hover { background: #dbeafe; }
.step-actions { display: flex; justify-content: space-between; margin-top: 24px; }

/* ── Divider ──────────────────────────────────────────── */
.auth-divider { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 24px; }
.auth-divider button, .auth-divider a {
  background: none; border: none;
  color: var(--primary); font-weight: 700;
  cursor: pointer; font-size: .85rem; text-decoration: none;
}

/* ── Confetti ─────────────────────────────────────────── */
.confetti-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -10px;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confetti-fall 2.5s ease-in forwards;
}

/* ── Success screen ───────────────────────────────────── */
.success-screen { text-align: center; padding: 20px 0; }
.success-icon { font-size: 3.5rem; margin-bottom: 16px; animation: pulse 1.5s ease infinite; }
.success-title { font-size: 1.4rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.success-msg { color: var(--muted); font-size: .95rem; line-height: 1.6; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
  .auth-page { margin: 20px auto; }
  .auth-card { padding: 28px 20px; border-radius: 18px; }
  .field-row { grid-template-columns: 1fr; }
  .auth-page-title { font-size: 1.6rem; }
  .stepper-line { width: 20px; }
}
