/* ═══════════════════════════════════════════════════════════════════════
   AppMare auth pages (Login / Register) — split layout.
   Left: the form. Right: the real editor, framed. Same tokens as landing.
   Keeps the ids/classes the scripts rely on: #authError (.d-none),
   .was-validated + .invalid-feedback, .is-loading + .btn-spinner,
   .strength[data-score] + .strength-text, .field-hint, [data-provider].
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --ink: #060311;
  --panel: #0a0d1c;
  --panel-2: #0e1326;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f7fd;
  --muted: #aab4c8;
  --subtle: #7d8cb0;
  --accent: #26b4e1;
  --grad: linear-gradient(135deg, #00b9f4 0%, #0d4cf2 100%);
  --danger: #ff7a7a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.auth {
  margin: 0; min-height: 100dvh;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: var(--ink); color: var(--text); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.d-none { display: none !important; }

/* ── Left: form column ─────────────────────────────────────────────────── */
.auth-form-col { display: flex; flex-direction: column; min-height: 100dvh; padding: 24px clamp(20px, 5vw, 64px) 32px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.auth-brand img { width: 32px; height: 32px; }
.auth-top .alt { font-size: 14px; color: var(--muted); text-decoration: none; }
.auth-top .alt b { color: var(--text); font-weight: 600; white-space: nowrap; }
@media (max-width: 520px) { .auth-top .alt .pre { display: none; } }
.auth-top .alt:hover b { color: var(--accent); }

.auth-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { margin: 0 0 8px; font-size: clamp(28px, 3vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.auth-card .lead { margin: 0 0 28px; color: var(--muted); font-size: 15.5px; }
.auth-card .lead a { color: var(--accent); text-decoration: none; }
.auth-card .lead a:hover { text-decoration: underline; }

/* Error banner (JS toggles .d-none) */
.alert-inline {
  margin: 0 0 18px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(255, 122, 122, .35); background: rgba(255, 122, 122, .1); color: #ffd1d1; font-size: 14px;
}

/* Fields */
form { display: flex; flex-direction: column; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-row a { font-size: 13px; color: var(--muted); text-decoration: none; }
.field-row a:hover { color: var(--accent); }
.input-wrap {
  position: relative; display: flex; align-items: center;
  border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .04);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(38, 180, 225, .18); background: rgba(255,255,255,.05); }
.input-wrap .lead-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--subtle); pointer-events: none; }
.input-wrap input {
  width: 100%; min-height: 50px; padding: 0 14px 0 44px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 15.5px; outline: none; border-radius: 12px;
}
.input-wrap input::placeholder { color: var(--subtle); }
.input-wrap input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px #11162a inset; }
.input-wrap .eye {
  position: absolute; right: 6px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--subtle); border-radius: 9px; cursor: pointer;
}
.input-wrap .eye:hover { background: rgba(255,255,255,.06); color: var(--text); }
.input-wrap .eye svg path { stroke: currentColor; }
.input-wrap:has(.eye) input { padding-right: 48px; }

.invalid-feedback { display: none; font-size: 13px; color: var(--danger); }
.was-validated .form-field:has(input:invalid) .invalid-feedback { display: block; }
.was-validated .form-field:has(input:invalid) .input-wrap { border-color: rgba(255, 122, 122, .7); }
.field-hint { font-size: 12.5px; color: var(--subtle); }
.pwd-rules { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pwd-rules span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; color: var(--subtle); border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: color .2s, border-color .2s, background .2s; }
.pwd-rules span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.pwd-rules span.ok { color: #7ff0b6; border-color: rgba(61,220,151,.35); background: rgba(61,220,151,.08); }
.pwd-rules span.ok::before { background: #3ddc97; }
.field-hint[hidden] { display: none; }
#confirmHint { color: var(--danger); }

/* Strength meter (register) */
.strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 6px; align-items: center; margin-top: 2px; }
.strength-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); }
.strength-text { font-size: 12px; color: var(--subtle); min-width: 44px; text-align: right; }
.strength[data-score="1"] .strength-bar:nth-child(-n+1) { background: #ff7a7a; }
.strength[data-score="2"] .strength-bar:nth-child(-n+2) { background: #ffc857; }
.strength[data-score="3"] .strength-bar:nth-child(-n+3) { background: #ffe49a; }
.strength[data-score="4"] .strength-bar:nth-child(-n+4) { background: #3ddc97; }
.strength[data-score="1"] .strength-text { color: #ff9a9a; }
.strength[data-score="2"] .strength-text { color: #ffd38a; }
.strength[data-score="3"] .strength-text { color: #ffe9b3; }
.strength[data-score="4"] .strength-text { color: #7ff0b6; }

/* Buttons */
.btn-gradient, .social-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 50px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  touch-action: manipulation; position: relative;
}
.btn-gradient { margin-top: 6px; background: var(--grad); background-origin: border-box; border: 0; color: #fff; box-shadow: 0 10px 28px -12px rgba(13, 76, 242, .9); }
.btn-gradient:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -12px rgba(13, 76, 242, 1); }
.btn-gradient:active { transform: translateY(0); }
.social-btn { background: rgba(255,255,255,.04); border-color: var(--line-strong); color: var(--text); }
.social-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.26); }
.social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-gradient:disabled, .social-btn:disabled { opacity: .7; cursor: progress; transform: none; }
.btn-spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite;
}
.is-loading .btn-spinner { display: inline-block; }
.is-loading .btn-label { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider-row { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--subtle); font-size: 13px; }
.divider-row .line { flex: 1; height: 1px; background: var(--line); }
.social-row { display: grid; gap: 10px; }
@media (min-width: 480px) { .social-row { grid-template-columns: 1fr 1fr; } }

.auth-foot { margin-top: 26px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--text); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { color: var(--accent); }
.auth-legal { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: left; line-height: 1.5; }
.auth-legal a { color: var(--muted); }
.auth-bottom { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.auth-bottom a { color: var(--muted); text-decoration: none; padding: 8px 0; }
.auth-bottom a:hover { color: var(--text); }

/* ── Right: product column ─────────────────────────────────────────────── */
.auth-visual {
  position: sticky; top: 0; max-height: 100dvh; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(32px, 5vw, 72px) clamp(32px, 5vw, 80px) clamp(32px, 5vw, 72px) clamp(32px, 5vw, 72px); border-left: 1px solid var(--line);
  background: radial-gradient(80% 60% at 70% 20%, rgba(13, 76, 242, .35), transparent 70%),
              radial-gradient(60% 50% at 20% 90%, rgba(0, 185, 244, .18), transparent 70%), #070a18;
}
.auth-visual h2 { margin: 0 0 12px; font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; max-width: 16ch; }
.auth-visual p { margin: 0 0 26px; color: var(--muted); font-size: 15.5px; max-width: 46ch; }
.auth-points { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--text); }
.auth-points li svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.auth-frame {
  position: relative; border-radius: 18px; overflow: hidden; margin-right: 0;
  background: #050311; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 50px 120px -40px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.08);
}
.auth-frame .bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #090c19; }
.auth-frame .bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a3150; }
.auth-frame .bar span { margin-left: 10px; font-size: 11.5px; color: var(--subtle); }
.auth-frame img { width: 100%; height: auto; }

/* Toasts (Bootstrap markup, our skin) */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 1080; display: grid; gap: 10px; width: min(420px, 92vw); }
.toast { display: none; border-radius: 12px; background: #0f1426; border: 1px solid var(--line-strong); color: var(--text); box-shadow: 0 24px 64px rgba(0,0,0,.6); font-size: 14px; }
.toast.show, .toast.showing { display: block; }
.toast .d-flex { display: flex; align-items: center; }
.toast .toast-body { padding: 12px 14px; flex: 1; }
.toast-accent-success { border-left: 3px solid #3ddc97; }
.toast .btn-close { width: 32px; height: 32px; margin-right: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.toast .btn-close::before { content: '×'; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  body.auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-col { min-height: 100dvh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
