/* ====== Design Tokens ====== */
:root {
  --bg: #0b0c0e;
  --card: rgba(18, 19, 22, 0.7);
  --card-border: rgba(255,255,255,0.06);
  --text: #e9eaee;
  --muted: #a9adb6;
  --ring: 66 133 244;              /* Google blue-ish ring, нейтрально смотрится */
  --surface: #0f1115;
  --error-bg: #2a1416;
  --error-stroke: #5b2326;
  --error-text: #ffb5b8;
  --radius: 16px;
  --shadow-lg: 0 8px 30px rgba(0,0,0,.45);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.03) inset;
  --primary: #3b82f6;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --card: rgba(255,255,255,0.75);
    --card-border: rgba(0,0,0,0.08);
    --text: #0b0c0e;
    --muted: #606469;
    --shadow-lg: 0 8px 30px rgba(0,0,0,.08);
    --shadow-sm: 0 1px 0 rgba(0,0,0,.04) inset;
  }
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "SF Pro Text", "SF Pro", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(59,130,246,.12), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(168,85,247,.10), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====== Layout ====== */
.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(560px, 92vw);
  background: var(--card);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid var(--card-border);
  border-radius: calc(var(--radius) + 4px);
  padding: 38px 34px;
  box-shadow: var(--shadow-lg), var(--shadow-sm);
  text-align: center;
}

/* ====== Typography ====== */
.title {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: .2px;
}

.subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

/* ====== Alerts ====== */
.alert {
  background: var(--error-bg);
  border: 1px solid var(--error-stroke);
  color: var(--error-text);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: left;
  margin-bottom: 14px;
  font-size: 14px;
}

/* ====== Form ====== */
.form {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

/* Плавающие лейблы */
.float-field {
  position: relative;
  display: block;
  text-align: left;
}

.float-field input {
  width: 100%;
  appearance: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  border-radius: calc(var(--radius) - 2px);
  padding: 18px 14px 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .02s ease;
  font-size: 15px;
}

.float-field input::placeholder { color: transparent; }

.float-field span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 6px;
  color: var(--muted);
  background: transparent;
  transition: all .15s ease;
  pointer-events: none;
  font-size: 14px;
}

/* Состояние focus/filled */
.float-field input:focus,
.float-field input:not(:placeholder-shown) {
  border-color: rgb(var(--ring));
  box-shadow: 0 0 0 3px rgba(var(--ring) / .18);
}

.float-field input:focus + span,
.float-field input:not(:placeholder-shown) + span {
  top: 2px;
  transform: none;
  font-size: 12px;
  background: var(--surface);
  border-radius: 8px;
  color: color-mix(in oklab, var(--muted) 85%, var(--text));
}

/* ====== Buttons ====== */
.btn-primary {
  margin-top: 6px;
  width: 100%;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  padding: 13px 16px;
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 92%, white) 0%, var(--primary) 100%);
  color: #fff;
  cursor: pointer;
  transition: transform .02s ease, filter .2s ease, box-shadow .15s ease;
  box-shadow: 0 6px 18px rgba(59,130,246,.28);
}
.btn-primary:hover { filter: brightness(1.03); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(var(--ring) / .22), 0 6px 18px rgba(59,130,246,.28); }

/* Вторичная кнопка-ссылка */
.btn-ghost {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  transition: border-color .15s, color .15s, background .15s;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: color-mix(in oklab, var(--text) 16%, transparent);
  background: color-mix(in oklab, var(--surface) 100%, transparent);
}

/* ====== Motion/Accessibility ====== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ====== Small screens ====== */
@media (max-width: 420px) {
  .login-card { padding: 28px 20px; }
}
