/* auth.css — login/register/verify დახვეწილი დიზაინი (ART KOLKHI-ის დონე).
   scoped კლასები: auth, oauth, pw, step. 2026-07-02: ლენდინგის მწვანე დიზაინზე
   გადაწყობილი — ღრმა მწვანეები 0E7C66/0A5E4D/07443A, coral აქცენტები მოხსნილია. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Georgian:wght@400;500;600;700;800&display=swap');

/* auth გვერდის ფონი — რბილი მწვანე gradient, ბარათი „ცურავს" */
body {
  background:
    radial-gradient(820px circle at 12% -5%, rgba(14, 124, 102, 0.12), transparent 60%),
    radial-gradient(720px circle at 92% 105%, rgba(14, 124, 102, 0.08), transparent 58%),
    var(--paper);
  font-family: 'Noto Sans Georgian', "Segoe UI", system-ui, -apple-system, sans-serif;
}

@keyframes authIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes orbFloat {
  from { transform: translate(0, 0); }
  to   { transform: translate(14px, -18px); }
}

.auth-shell {
  width: min(980px, calc(100% - 32px));
  margin: 56px auto 84px;
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  box-shadow:
    0 44px 90px -34px rgba(10, 40, 28, 0.42),
    0 14px 34px -16px rgba(10, 40, 28, 0.20);
  overflow: visible;
  animation: authIn 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ───────── ბრენდ-პანელი (მარცხნივ) ───────── */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 50px 34px;
  color: #fff;
  /* ლენდინგის ღრმა მწვანე — №641/CTA ბლოკების იდენტური ტონი */
  background:
    linear-gradient(160deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(160deg, #07443A 0%, #0E7C66 100%);
  overflow: hidden;
  isolation: isolate;
  border-radius: 26px 0 0 26px;
}
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}
.auth-brand::before {
  top: -80px;
  right: -70px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(236, 200, 136, 0.45), transparent 66%);
  animation: orbFloat 9s ease-in-out infinite alternate;
}
.auth-brand::after {
  bottom: -100px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
  animation: orbFloat 12s ease-in-out infinite alternate-reverse;
}
.auth-logo-badge {
  position: relative;
  display: inline-block;
  margin-bottom: 4px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}
.auth-logo-badge::after {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 38px;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
}
.auth-logo-badge img {
  display: block;
  width: 172px;
  height: auto;
  padding: 16px 20px;
  background: #fff;
  border-radius: 22px;
}
.auth-brand h2 {
  margin: 8px 0 2px;
  color: #fff;
  font-size: 1.68rem;
  line-height: 1.22;
  letter-spacing: 0.005em;
}
.auth-brand h2::after {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
}
.auth-brand > p {
  margin: 0;
  max-width: 32ch;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.96rem;
  line-height: 1.62;
}
.auth-points {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}
.auth-points li {
  position: relative;
  padding-left: 30px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.92rem;
  font-weight: 600;
}
.auth-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}
.auth-badge {
  margin-top: 6px;
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ───────── ფორმის მხარე (მარჯვნივ) ───────── */
.auth-main {
  display: flex;
  align-items: center;
  padding: 42px clamp(24px, 4vw, 46px);
}
.auth-form {
  width: 100%;
}
.auth-form h1 {
  margin-bottom: 6px;
  font-size: 2.15rem;
  letter-spacing: -0.01em;
}
.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
}
.auth-form label {
  margin-bottom: 15px;
}
.auth-form label .opt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.8;
}

/* inputs — თეთრი, ლენდინგის ველების სტილში */
.auth-form input:not([type="hidden"]) {
  background: #fff;
  border: 1px solid #D8E0DD;
  border-radius: 11px;
  padding: 14px 15px;
  font-size: 1rem;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form input:not([type="hidden"])::placeholder {
  color: rgba(22, 36, 42, 0.4);
}
.auth-form input:not([type="hidden"]):focus {
  background: #fff;
  border-color: #0E7C66;
  outline: 3px solid rgba(14, 124, 102, 0.14);
}
/* Chrome-ის autofill ლურჯი ფონის მოხსნა */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 60px #fff inset;
  box-shadow: 0 0 0 60px #fff inset;
  -webkit-text-fill-color: var(--ink);
}

/* primary ღილაკები — ლენდინგის მწვანე, ბრტყელი */
.auth-form .button,
.auth-form button.button {
  background: #0E7C66;
  color: #fff;
  border: none;
  border-radius: 12px;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px -8px rgba(14, 124, 102, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.auth-form .button:hover,
.auth-form button.button:hover {
  transform: translateY(-2px);
  background: #0A5E4D;
  box-shadow: 0 16px 30px -10px rgba(14, 124, 102, 0.6);
}
.auth-form .button:active,
.auth-form button.button:active {
  transform: translateY(0);
}

/* password + eye toggle */
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input {
  width: 100%;
  padding-right: 46px !important;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.pw-toggle:hover {
  color: var(--green);
  background: rgba(22, 36, 42, 0.05);
}
.pw-toggle .eye-off {
  display: none;
}
.pw-toggle.is-on .eye-on {
  display: none;
}
.pw-toggle.is-on .eye-off {
  display: block;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

/* ───────── stepper (register) ───────── */
.auth-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 22px;
}
.auth-stepper .step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}
.auth-stepper .step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-size: 0.85rem;
  transition: all 0.18s ease;
}
.auth-stepper .step.active .step-num,
.auth-stepper .step.done .step-num {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.auth-stepper .step.active {
  color: var(--ink);
}
.auth-stepper .step-line {
  width: 42px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.auth-step[hidden] {
  display: none;
}
.step-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.step-actions .button {
  flex: 1;
}
.step-back {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0 6px;
  white-space: nowrap;
}
.step-back:hover {
  color: var(--green);
}

/* ───────── notice (error/success) ───────── */
.notice.error {
  color: #8a1f2e;
  background: #fbe6e8;
}
.notice.error div + div {
  margin-top: 4px;
}

/* ───────── divider „ან" ───────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ───────── OAuth ღილაკები ───────── */
.oauth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.oauth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.oauth-button svg {
  flex: 0 0 auto;
}
.oauth-button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow-sm);
}
.oauth-button.facebook {
  border-color: rgba(24, 119, 242, 0.35);
}
.oauth-button.facebook:hover {
  border-color: #1877f2;
}

/* ───────── ხელახ. გაგზავნა / auth-note / message ───────── */
.resend-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: #0E7C66;
  font: inherit;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}
.resend-link:hover {
  text-decoration: underline;
}
.auth-note {
  text-align: center;
}
/* coral აქცენტების ჩანაცვლება მწვანეთი — მხოლოდ auth გვერდებზე */
.auth-form .eyebrow,
.auth-form .eyebrow.dark,
.auth-message .eyebrow,
.auth-message .eyebrow.dark {
  color: #0E7C66;
}
.auth-form .text-link,
.auth-message .text-link {
  color: #0E7C66;
  font-weight: 800;
}
.auth-form .text-link:hover,
.auth-message .text-link:hover {
  color: #0A5E4D;
}
.auth-message {
  text-align: center;
}
.auth-message h1 {
  margin-bottom: 12px;
}

/* ───────── სკოლის select-combobox ───────── */
.ms-select {
  position: relative;
  display: block;
  min-width: 0;
  max-width: 100%;
}
/* მრავალი სკოლა — არჩეული ჩიპები */
.ms-schools { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.ms-schools:empty { display: none; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 8px 6px 12px; border-radius: 999px;
  background: var(--brand-08, rgba(31,138,91,.10)); color: var(--brand-ink, #14613f);
  border: 1px solid var(--brand-16, rgba(31,138,91,.22)); font-size: 13px; font-weight: 600;
}
.ms-chip__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42ch; }
.ms-chip__x {
  flex: 0 0 auto; width: 20px; height: 20px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(22,36,42,.10); color: inherit; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ms-chip__x:hover { background: rgba(200,40,40,.16); color: #b52a2a; }
.ms-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid rgba(22, 36, 42, 0.10);
  border-radius: var(--radius-sm);
  background: #eef1f0;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ms-select-trigger.is-open {
  background: var(--white);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.ms-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}
.ms-select-value.is-placeholder {
  color: rgba(22, 36, 42, 0.45);
}
.ms-select-caret {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.ms-select-trigger.is-open .ms-select-caret {
  transform: rotate(180deg);
}
.ms-select-panel {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 50px -16px rgba(10, 40, 28, 0.36);
}
.ms-select-panel[hidden] {
  display: none;
}
.ms-select-search {
  position: relative;
  margin-bottom: 8px;
}
.ms-select-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.ms-select-q {
  width: 100%;
  padding: 11px 12px 11px 38px !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px;
  background: var(--white) !important;
  font: inherit;
}
.ms-select-q:focus {
  outline: 3px solid rgba(0, 0, 0, 0.05);
  border-color: var(--green) !important;
}
.ms-select-list {
  max-height: 264px;
  overflow-y: auto;
}
.ms-select-group {
  padding: 9px 10px 5px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}
.ms-select-opt {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}
.ms-select-opt:hover,
.ms-select-opt.is-active {
  background: rgba(31, 138, 91, 0.10);
}
.ms-select-hint {
  padding: 16px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ───────── header user-chip ───────── */
.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ───────── responsive ───────── */
@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
  .auth-brand {
    padding: 34px 30px 30px;
    border-radius: 26px 26px 0 0;
  }
  .auth-brand h2 {
    font-size: 1.4rem;
  }
  .auth-points {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    width: calc(100% - 24px);
    margin: 24px auto 48px;
    border-radius: 20px;
  }
  .auth-brand {
    padding: 28px 22px 26px;
    border-radius: 20px 20px 0 0;
  }
  .auth-logo-badge img {
    width: 140px;
    padding: 13px 16px;
  }
  .auth-main {
    padding: 28px 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .oauth-row {
    grid-template-columns: 1fr;
  }
  .auth-form h1 {
    font-size: 1.6rem;
  }
  /* submit/OAuth — თითის ზომის tap target (styles.css მობილურზე 38px-მდე წევს) */
  .auth-form .button,
  .auth-form button.button {
    min-height: 48px;
  }
  .auth-stepper .step-label {
    display: none;
  }
  .auth-stepper .step-line {
    width: 28px;
  }
}
