/* ============================================================
   home.gr — «Θερμό χαρτί» — Auth (Sign in / Sign up)
   Split screen: deep-green brand panel (left) + form card (right).
   Light-only. Reuses tokens/fonts/header/footer from deep-green.css.
   ============================================================ */

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* full-height column so footer sits at the bottom */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------------- HEADER back link ---------------- */
.hd-back {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  transition: color .2s;
}
.hd-back:hover { color: var(--ink); }
.hd-back svg { width: 16px; height: 16px; }

/* ============================================================
   SPLIT LAYOUT
   ============================================================ */
.auth-main { flex: 1; }
.auth-split {
  max-width: var(--maxw); margin-inline: auto;
  padding: clamp(1.5rem, 3vw, 3.5rem) var(--gutter) clamp(3rem, 5vw, 5rem);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: stretch;
}

/* ============================================================
   BRAND PANEL (left)
   ============================================================ */
.auth-brand {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 3vw, 3.25rem);
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 90% at 78% 12%, rgba(249,247,241,.10), transparent 55%),
    radial-gradient(90% 90% at 15% 95%, rgba(12,32,18,.5), transparent 60%),
    linear-gradient(158deg, var(--cypress), #1B3D22 82%);
  color: var(--on-green);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow-lg);
}
/* faint grid texture */
.auth-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 80% at 70% 20%, #000, transparent 75%);
}

.auth-brand .brand-eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(249,247,241,.85); position: relative;
}
.auth-brand .brand-eyebrow .live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mint-soft);
  box-shadow: 0 0 0 0 rgba(196,101,63,.5); animation: livePulse 2.4s var(--ease) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .auth-brand .brand-eyebrow .live { animation: none; }
}
.auth-brand h2 {
  position: relative;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem);
  line-height: 1.04; letter-spacing: -0.02em;
  margin: 1.4rem 0 0; max-width: 15ch;
  color: var(--on-green);
}
.auth-brand h2 em { font-family: var(--font-accent); font-style: italic; font-weight: 500; color: inherit; }
.auth-brand .brand-sub {
  position: relative;
  font-size: var(--fs-lead); color: rgba(249,247,241,.85);
  margin: 1.1rem 0 0; max-width: 34ch;
}

/* highlights */
.brand-points { position: relative; margin-top: auto; padding-top: clamp(2rem, 4vw, 3rem); display: flex; flex-direction: column; gap: 1.15rem; }
.bpoint { display: flex; gap: .9rem; align-items: flex-start; }
.bpoint .ic {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.1); color: var(--mint-soft);
  border: 1px solid rgba(255,255,255,.14);
}
.bpoint .ic svg { width: 20px; height: 20px; }
.bpoint .bt b { display: block; font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-body); color: var(--on-green); }
.bpoint .bt span { display: block; font-size: var(--fs-sm); color: rgba(249,247,241,.75); margin-top: .15rem; }

.brand-foot {
  position: relative; margin-top: clamp(1.75rem, 3vw, 2.5rem);
  padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; gap: .75rem;
  font-size: var(--fs-sm); color: rgba(249,247,241,.8);
}
.brand-foot .foot-ic { color: var(--mint-soft); display: inline-flex; }
.brand-foot .foot-ic svg { width: 15px; height: 15px; }
.brand-foot b { color: var(--on-green); font-weight: 600; }

/* ============================================================
   FORM PANEL (right)
   ============================================================ */
.auth-panel { display: flex; align-items: center; justify-content: center; }
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
}

/* tabs */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  padding: 3px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  margin-bottom: 1.75rem;
}
.auth-tabs button {
  appearance: none; border: 0; cursor: pointer; background: transparent;
  font: 600 var(--fs-sm)/1 var(--font-ui); color: var(--ink-3);
  padding: .7em 1em; border-radius: 999px; transition: .22s var(--ease);
}
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgba(30,27,22,.10); }

.auth-head { margin-bottom: 1.4rem; }
.auth-head h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.015em; }
.auth-head p { color: var(--ink-2); font-size: var(--fs-sm); margin: .5rem 0 0; }

/* form panes */
.auth-form { display: none; flex-direction: column; gap: 1.05rem; }
.auth-form.active { display: flex; }

/* fields */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > label {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
  color: var(--ink-2);
}
.field .input-wrap { position: relative; display: flex; align-items: center; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%; appearance: none;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hairline-2); border-radius: var(--radius-sm);
  padding: .85rem 1rem; font: 500 var(--fs-body)/1.2 var(--font-ui);
  transition: border-color .2s, box-shadow .2s, background .2s;
  min-height: 50px;
}
.field .input-wrap.has-toggle input,
.field .input-wrap.has-icon input { padding-right: 3rem; }
.field input::placeholder { color: var(--ink-3); }
.field input:focus {
  outline: none; border-color: var(--mint);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--mint) 22%, transparent);
  background: var(--surface);
}

/* password show/hide */
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer; transition: color .2s;
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle svg { width: 19px; height: 19px; }
.pw-toggle .ic-hide { display: none; }
.pw-toggle[aria-pressed="true"] .ic-show { display: none; }
.pw-toggle[aria-pressed="true"] .ic-hide { display: block; }

/* validation states */
.field .msg {
  display: none; align-items: center; gap: .35rem;
  font-size: var(--fs-xs); font-weight: 500;
}
.field .msg svg { width: 14px; height: 14px; flex-shrink: 0; }
.field.invalid input { border-color: var(--danger); }
.field.invalid input:focus { box-shadow: 0 0 0 3px rgba(179,64,47,.18); }
.field.invalid .msg.err { display: inline-flex; color: var(--danger); }
.field.valid input { border-color: var(--verified); }
.field.valid .msg.ok { display: inline-flex; color: var(--verified); }

/* row: forgot / remember */
.field-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: -.2rem; }
.link-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: 600 var(--fs-sm)/1 var(--font-ui); color: var(--mint); padding: 0; transition: color .2s;
}
.link-btn:hover { color: var(--mint-hover); text-decoration: underline; }

/* remember + terms checkboxes */
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px;
  border: 1.5px solid var(--hairline-2); background: var(--surface-2);
  display: grid; place-items: center; transition: .18s var(--ease);
}
.check .box svg { width: 13px; height: 13px; color: var(--on-mint); opacity: 0; transform: scale(.5); transition: .18s var(--ease); }
.check input:checked + .box { background: var(--mint); border-color: transparent; }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { outline: 2.5px solid var(--mint); outline-offset: 2px; }
.check a { color: var(--mint); font-weight: 600; }
.check a:hover { color: var(--mint-hover); text-decoration: underline; }
.check.invalid .box { border-color: var(--danger); }

/* role pill toggle */
.role-pills { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.role-pill {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: .65rem;
  padding: .85rem 1rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--hairline-2); background: var(--surface-2);
  transition: .2s var(--ease);
}
.role-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-pill .ic {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2); transition: .2s;
}
.role-pill .ic svg { width: 18px; height: 18px; }
.role-pill .rt b { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.role-pill .rt span { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.role-pill:hover { border-color: var(--hairline-2); transform: translateY(-1px); }
.role-pill:has(input:checked) {
  border-color: var(--mint);
  background: color-mix(in oklab, var(--mint) 10%, var(--surface-2));
}
.role-pill:has(input:checked) .ic { background: var(--mint); color: var(--on-mint); }
.role-pill:has(input:focus-visible) { outline: 2.5px solid var(--mint); outline-offset: 2px; }

/* password strength meter */
.pw-strength { display: none; flex-direction: column; gap: .4rem; margin-top: -.2rem; }
.pw-strength.show { display: flex; }
.pw-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pw-bars i { height: 5px; border-radius: 999px; background: var(--surface-3); transition: background .3s var(--ease); }
.pw-strength[data-level="1"] .pw-bars i:nth-child(-n+1) { background: var(--danger); }
.pw-strength[data-level="2"] .pw-bars i:nth-child(-n+2) { background: var(--declared); }
.pw-strength[data-level="3"] .pw-bars i:nth-child(-n+3) { background: var(--cypress-lift); }
.pw-strength[data-level="4"] .pw-bars i { background: var(--verified); }
.pw-strength .pw-label { font-size: var(--fs-xs); color: var(--ink-3); }
.pw-strength .pw-label b { font-weight: 600; }
.pw-strength[data-level="1"] .pw-label b { color: var(--danger); }
.pw-strength[data-level="2"] .pw-label b { color: var(--declared); }
.pw-strength[data-level="3"] .pw-label b { color: var(--cypress-lift); }
.pw-strength[data-level="4"] .pw-label b { color: var(--verified); }

/* submit */
.auth-form .btn-submit { width: 100%; margin-top: .3rem; min-height: 52px; font-size: var(--fs-body); }

/* divider */
.or-divider {
  display: flex; align-items: center; gap: 1rem; margin: .3rem 0;
  color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* social buttons */
.social-btns { display: flex; flex-direction: column; gap: .7rem; }
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  width: 100%; min-height: 50px; padding: 0 1.2em;
  border-radius: 999px; border: 1px solid var(--hairline-2); background: var(--surface-2);
  color: var(--ink); font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.btn-social:hover { border-color: var(--hairline-2); background: var(--surface-3); transform: translateY(-1px); }
.btn-social svg { width: 19px; height: 19px; flex-shrink: 0; }

/* switch prompt below card */
.auth-switch { text-align: center; margin-top: 1.3rem; font-size: var(--fs-sm); color: var(--ink-3); }
.auth-switch .link-btn { font-size: var(--fs-sm); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { order: 2; }
  .auth-panel { order: 1; }
  .auth-brand h2 { max-width: none; }
  .brand-points { padding-top: 1.75rem; }
}
@media (max-width: 480px) {
  .role-pills { grid-template-columns: 1fr; }
  .auth-card { padding: 1.25rem; }
}

/* Αποτυχία OAuth στο callback — μόνιμο μήνυμα, όχι toast που σβήνει, με
   ρητή αναφορά στην εναλλακτική που δουλεύει πάντα (email + κωδικός). */
.auth-alert {
  display: flex; flex-direction: column; gap: .25rem;
  margin: 0 0 1.25rem; padding: .85rem 1rem;
  border: 1px solid var(--danger); border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--danger) 7%, var(--surface));
}
.auth-alert b { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.auth-alert span { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.5; }
