/* auth.css — single-column auth layout (sign-in / sign-up / forgot-password). */
:root {
  --sa-bg: #FCFCFD;
  --sa-ink: #17191C;
  --sa-text: #3F4651;
  --sa-muted: #737B87;
  --sa-muted2: #A2A8B1;
  --sa-field: #F5F6F7;
  --sa-field-h: #F0F1F3;
  --sa-border: #E7E9EC;
  --sa-line: #EEF0F2;
  --sa-graphite: #24282D;
  --sa-graphite-h: #33383F;
  --sa-ring: rgba(36, 40, 45, .10);
  --sa-err: #D9443B;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--sa-ink);
  background: var(--sa-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; }

/* very faint dotted grid, fading out from the top centre */
.sa-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sa-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(23, 25, 28, .045) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 55% 45% at 50% 28%, #000 0%, transparent 80%);
  mask-image: radial-gradient(ellipse 55% 45% at 50% 28%, #000 0%, transparent 80%);
}

.sa-page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px 32px;
}
.sa-card { width: 100%; max-width: 360px; animation: saIn .4s cubic-bezier(.2, .8, .3, 1); }
@keyframes saIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── head ─────────────────────────────────────────────────────────────── */
.sa-head { text-align: center; }
/* same mark as the app sidebar (public/img/gamler.jpg → gamler-132.webp) */
.sa-logo {
  display: block; width: 44px; height: 44px; margin: 0 auto 20px;
  border-radius: 12px; overflow: hidden;
  background: #07090F;
}
.sa-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sa-title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.sa-lead { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--sa-muted); }

/* ── form ─────────────────────────────────────────────────────────────── */
.sa-form { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.sa-field { position: relative; }

/* Transparent field; the outline is drawn as an inset stroke (1px → 2px on focus)
   so the thicker focus line never shifts the text or the layout. */
.sa-input {
  display: block; width: 100%; height: 46px; padding: 0 14px;
  border: 0; border-radius: 10px; outline: 0;
  background: transparent; color: var(--sa-ink);
  box-shadow: inset 0 0 0 1px var(--sa-border);
  font-size: 14px; font-weight: 400;
  transition: box-shadow .15s;
}
.sa-input::placeholder { color: transparent; }
.sa-input:hover { box-shadow: inset 0 0 0 1px #CDD1D6; }
.sa-input:focus { box-shadow: inset 0 0 0 2px var(--sa-graphite); }
/* autofill paints its own background — cover it with the page colour, keep the stroke */
.sa-input:-webkit-autofill,
.sa-input:-webkit-autofill:hover {
  -webkit-box-shadow: inset 0 0 0 1px var(--sa-border), inset 0 0 0 100px var(--sa-bg) !important;
  -webkit-text-fill-color: var(--sa-ink);
  caret-color: var(--sa-ink);
  transition: background-color 9999s ease-out 0s;
}
.sa-input:-webkit-autofill:focus {
  -webkit-box-shadow: inset 0 0 0 2px var(--sa-graphite), inset 0 0 0 100px var(--sa-bg) !important;
}
.sa-field--pw .sa-input { padding-right: 44px; }

/* floating label: sits inside the field, rides up onto the stroke when filled/focused */
.sa-label {
  position: absolute; left: 10px; top: 13px; max-width: calc(100% - 20px);
  padding: 0 4px; border-radius: 4px;
  background: var(--sa-bg);
  color: var(--sa-muted2); font-size: 14px; font-weight: 400; line-height: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
  transform-origin: left center;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), color .15s;
}
.sa-field--pw .sa-label { max-width: calc(100% - 54px); }
.sa-input:focus ~ .sa-label,
.sa-input:not(:placeholder-shown) ~ .sa-label,
.sa-input:-webkit-autofill ~ .sa-label {
  transform: translateY(-23px) scale(.857); /* 14px → 12px */
  color: var(--sa-muted);
}
.sa-input:focus ~ .sa-label { color: var(--sa-ink); }
.sa-eye {
  position: absolute; right: 6px; top: 6px; width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--sa-muted2);
  cursor: pointer; transition: color .15s, background .15s;
}
.sa-eye:hover { color: var(--sa-text); background: var(--sa-field); }
.sa-eye svg { width: 16px; height: 16px; }

.sa-promo .sa-input { text-transform: uppercase; letter-spacing: .05em; }
.sa-promo .sa-input:placeholder-shown { text-transform: none; letter-spacing: 0; }

.sa-hint { margin: 6px 0 0; padding-left: 2px; font-size: 12px; color: var(--sa-muted); }
.sa-hint--err { color: var(--sa-err); }
.sa-field.is-invalid .sa-input,
.sa-field.is-invalid .sa-input:hover { box-shadow: inset 0 0 0 1px var(--sa-err); }
.sa-field.is-invalid .sa-input:focus { box-shadow: inset 0 0 0 2px var(--sa-err); }
.sa-field.is-invalid .sa-label { color: var(--sa-err); }

.sa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sa-row--end { justify-content: flex-end; }

.sa-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--sa-muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color .15s;
}
.sa-link:hover { color: var(--sa-ink); }
.sa-link svg { width: 12px; height: 12px; }

.sa-turnstile { margin-top: 2px; }

.sa-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 44px; margin-top: 8px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--sa-graphite); color: #fff;
  font-size: 14px; font-weight: 500;
  transition: background .15s, opacity .15s;
}
.sa-btn:hover:not(:disabled) { background: var(--sa-graphite-h); }
.sa-btn:disabled { opacity: .35; cursor: not-allowed; }
.sa-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--sa-ring); }
.sa-btn > span { display: inline-flex; align-items: center; gap: 8px; }
.sa-spin { width: 14px; height: 14px; animation: saSpin .8s linear infinite; }
@keyframes saSpin { to { transform: rotate(360deg); } }

/* ── foot: switch link + language ─────────────────────────────────────── */
.sa-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.sa-switch { font-size: 13px; color: var(--sa-muted); }
.sa-switch a { margin-left: 2px; font-weight: 500; color: var(--sa-ink); text-decoration: none; }
.sa-switch a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sa-muted2); }

/* forgot / reset password: back link + status icons */
.sa-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--sa-muted); text-decoration: none; transition: color .15s; }
.sa-back:hover { color: var(--sa-ink); }
.sa-back svg { transition: transform .15s; }
.sa-back:hover svg { transform: translateX(-2px); }
.sa-sent-ico { width: 44px; height: 44px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--sa-field); color: var(--sa-text); }
.sa-sent-ico--err { background: #FDF0EF; color: var(--sa-err); }
a.sa-btn, a.sa-btn:hover { color: #fff; text-decoration: none; }

/* language switcher from includes/auth-lang.php, re-seated inline and lightened */
.sa-foot .al-switch { position: relative; top: auto; right: auto; z-index: 5; flex-shrink: 0; }
.sa-foot .al-btn { height: 30px; gap: 6px; padding: 0 6px; margin-right: -6px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--sa-muted); }
.sa-foot .al-btn:hover, .sa-foot .al-btn.open { background: var(--sa-field); color: var(--sa-ink); }
.sa-foot .al-btn img { width: 16px; height: 16px; }
.sa-foot .al-menu { top: auto; bottom: calc(100% + 6px); transform-origin: 100% 100%; min-width: 170px; border-radius: 10px; padding: 4px;
  box-shadow: 0 0 0 1px rgba(23, 25, 28, .06), 0 8px 24px -8px rgba(23, 25, 28, .14); }
.sa-foot .al-opt { height: 34px; font-size: 13px; font-weight: 500; border-radius: 7px; }

.sa-terms {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--sa-line);
  text-align: center; font-size: 11.5px; line-height: 1.6; color: var(--sa-muted2);
}
.sa-terms a { color: var(--sa-muted); text-decoration: none; }
.sa-terms a:hover { color: var(--sa-ink); text-decoration: underline; text-underline-offset: 2px; }

[x-cloak] { display: none !important; }

@media (max-width: 480px) {
  .sa-page { justify-content: flex-start; padding: 56px 16px 28px; }
  .sa-title { font-size: 20px; }
  .sa-input { height: 48px; font-size: 16px; } /* 16px keeps iOS Safari from zooming in on focus */
  .sa-label { top: 14px; font-size: 15px; }
  .sa-input:focus ~ .sa-label,
  .sa-input:not(:placeholder-shown) ~ .sa-label,
  .sa-input:-webkit-autofill ~ .sa-label { transform: translateY(-24px) scale(.8); }
  .sa-btn { height: 46px; font-size: 15px; }
  .sa-foot { flex-wrap: wrap; }
}
