/* ============== AUTH SCREENS ============== */
.auth {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 480px 1fr;
  background: var(--surface);
  font-family: var(--font-sans);
  color: var(--text);
  overflow: hidden;
}

/* Brand / hero panel (left) */
.auth-hero {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 0%, oklch(75% 0.17 45 / 0.5) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, oklch(55% 0.10 200 / 0.4) 0%, transparent 50%),
    linear-gradient(180deg, oklch(22% 0.015 240) 0%, oklch(18% 0.015 240) 100%);
  color: white;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auth-hero::after {
  /* Subtle grid texture */
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(oklch(100% 0 0 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, oklch(100% 0 0 / 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 40%, black 0%, transparent 70%);
}

.auth-brand {
  display: flex; align-items: center; gap: 12px;
  position: relative; z-index: 1;
}
.auth-brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 18px;
  box-shadow: 0 8px 20px -6px oklch(70% 0.16 45 / 0.6);
}
.auth-brand .name {
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
}
.auth-brand .name .sub {
  display: block;
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(72% 0.012 240);
  margin-top: 1px;
}

.auth-hero-body {
  margin-top: auto; margin-bottom: auto;
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 20px;
}
.auth-hero-eyebrow {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: oklch(75% 0.012 240);
  display: inline-flex; align-items: center; gap: 8px;
}
.auth-hero-eyebrow::before {
  content: ''; width: 24px; height: 1px; background: oklch(75% 0.012 240);
}
.auth-hero h1 {
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.1;
  margin: 0;
  color: white;
}
.auth-hero h1 em {
  font-style: normal;
  color: var(--brand);
}
.auth-hero p.lede {
  font-size: 15px; line-height: 1.55;
  color: oklch(80% 0.012 240);
  max-width: 38ch;
  margin: 0;
}

/* Feature checklist */
.auth-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.auth-feat {
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px; color: oklch(85% 0.012 240);
}
.auth-feat .tick {
  width: 22px; height: 22px; border-radius: 6px;
  background: oklch(35% 0.04 200);
  display: grid; place-items: center;
  color: var(--brand);
  flex: 0 0 22px;
}

.auth-hero-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
  color: oklch(65% 0.012 240);
  padding-top: 24px;
  border-top: 1px solid oklch(100% 0 0 / 0.08);
}
.auth-hero-foot a { color: oklch(80% 0.012 240); text-decoration: none; }

/* Form panel (right) */
.auth-form-wrap {
  display: flex; flex-direction: column;
  padding: 32px 56px;
  background: var(--surface);
  overflow-y: auto;
}
.auth-form-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-2);
}
.auth-form-top .lang {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border);
  font-weight: 500; color: var(--text);
  background: var(--surface);
}
.auth-form-top .alt {
  color: var(--text-3);
}
.auth-form-top .alt a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
  border-bottom: 1px solid var(--text);
  padding-bottom: 1px;
}

.auth-form {
  margin: auto;
  width: 100%;
  max-width: 440px;
  display: flex; flex-direction: column; gap: 22px;
  padding: 32px 0;
}
.auth-form.wide { max-width: 720px; }

.auth-form-head .eyebrow {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--brand-2);
}
.auth-form-head h2 {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.022em; line-height: 1.15;
  margin: 6px 0 6px;
}
.auth-form-head p {
  font-size: 14.5px; color: var(--text-2);
  margin: 0; line-height: 1.5;
}

/* Inputs */
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field label {
  font-size: 13px; font-weight: 500;
  color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
}
.auth-field label .opt {
  font-weight: 400;
  color: var(--text-3);
  font-size: 12px;
}
.auth-input {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  transition: border 0.12s, box-shadow 0.12s, background 0.12s;
  height: 46px;
}
.auth-input:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 4px oklch(22% 0.02 250 / 0.07);
}
.auth-input .lead {
  color: var(--text-3);
  display: grid; place-items: center;
  flex: 0 0 18px;
}
.auth-input input, .auth-input select {
  flex: 1;
  border: 0; outline: 0; background: transparent;
  font-size: 14.5px;
  color: var(--text);
  padding: 12px 0;
  min-width: 0;
}
.auth-input input::placeholder { color: var(--text-3); }
.auth-input select {
  appearance: none;
  padding-right: 4px;
  cursor: pointer;
}
.auth-input .tail {
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: grid; place-items: center;
}
.auth-input .tail:hover { color: var(--text); background: var(--surface-2); }
.auth-input.dial { padding-left: 0; }
.auth-input.dial .prefix {
  height: 100%;
  padding: 0 12px;
  display: flex; align-items: center; gap: 6px;
  border-right: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-2);
  border-radius: 12px 0 0 12px;
}

/* Password strength meter */
.pw-meter {
  display: flex; gap: 4px;
  margin-top: 2px;
}
.pw-meter .seg {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
}
.pw-meter.l1 .seg:nth-child(-n+1) { background: var(--danger); }
.pw-meter.l2 .seg:nth-child(-n+2) { background: var(--warn); }
.pw-meter.l3 .seg:nth-child(-n+3) { background: var(--accent); }
.pw-meter.l4 .seg { background: var(--success); }
.pw-hint { font-size: 12px; color: var(--text-3); }

/* Row helpers */
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.auth-check {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--text);
  cursor: pointer;
  user-select: none;
}
.auth-check input {
  appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  position: relative;
  background: var(--surface);
}
.auth-check input:checked {
  background: var(--text);
  border-color: var(--text);
}
.auth-check input:checked::after {
  content: '';
  width: 10px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: contain;
}
.auth-link {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  transition: border 0.12s, color 0.12s;
}
.auth-link:hover { color: var(--brand-2); border-color: var(--brand); }

/* Primary CTA */
.auth-cta {
  height: 50px;
  border-radius: 12px;
  background: var(--text);
  color: white;
  font-size: 14.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: 0;
  transition: background 0.12s, transform 0.06s;
  letter-spacing: -0.005em;
}
.auth-cta:hover { background: oklch(15% 0.015 240); }
.auth-cta:active { transform: translateY(1px); }
.auth-cta.brand {
  background: var(--brand);
  box-shadow: 0 1px 2px oklch(70% 0.16 45 / 0.3), 0 6px 16px -6px oklch(70% 0.16 45 / 0.5);
}
.auth-cta.brand:hover { background: var(--brand-2); }

/* Divider with label */
.auth-or {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.auth-or::before, .auth-or::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Social buttons */
.auth-socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-social {
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.auth-social:hover { background: var(--surface-2); border-color: var(--border-strong); }
.auth-social svg { flex: 0 0 18px; }

/* Role toggle (paciente / doctor) */
.role-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.role-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
  text-align: left;
  border: 0; background: transparent;
}
.role-opt .ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  flex: 0 0 36px;
}
.role-opt .copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.role-opt .copy .t { font-size: 13.5px; font-weight: 600; color: var(--text); }
.role-opt .copy .s { font-size: 11.5px; color: var(--text-3); }
.role-opt.active {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.role-opt.active .ico {
  background: var(--brand-soft);
  color: var(--brand-2);
  border-color: transparent;
}

/* Two-column field grid for registration */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.auth-grid.col-1 { grid-template-columns: 1fr; }
.auth-grid .span-2 { grid-column: span 2; }

/* Section eyebrow inside form */
.auth-section {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 4px;
}
.auth-section::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Stepper indicator */
.auth-step {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3);
  font-family: var(--font-mono); font-weight: 500;
}
.auth-step .num {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--text); color: white;
  font-size: 11px; font-weight: 700;
}

/* Inline alert (e.g. success after sending recovery email) */
.auth-alert {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--success-soft);
  border: 1px solid oklch(85% 0.07 150);
  color: oklch(35% 0.08 150);
  font-size: 13.5px; line-height: 1.5;
}
.auth-alert .ico {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--success);
  color: white;
  display: grid; place-items: center;
  flex: 0 0 22px;
}
.auth-alert b { display: block; margin-bottom: 2px; font-weight: 700; }

/* Footer credits */
.auth-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
}
.auth-foot a { color: var(--text-2); text-decoration: none; }
.auth-foot a:hover { color: var(--text); }

/* ===== Responsive ===== */
html, body { height: 100%; margin: 0; }
.auth-screen { height: 100vh; }
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .auth-hero { display: none; }
  .auth-form-wrap { padding: 28px 22px; }
  .auth-form { padding: 16px 0; }
  .auth-form.wide, .auth-form { max-width: 100% !important; }
  .auth-grid, .auth-grid.col-1 { grid-template-columns: 1fr; }
}
