:root {
  --auth-bg: #0f0f14;
  --auth-card: #111d25;
  --auth-border: #29414e;
  --auth-text: #f1f6fa;
  --auth-muted: #a0b1bd;
  --auth-accent: #00e5ff;
  --auth-accent-dim: #61eeff;
  --auth-alert: #ff6b6b;
  --auth-radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-page {
  font-family: 'Inter', sans-serif;
  color: var(--auth-text);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: clip;
  overflow-y: auto;
  /* Фон мережі: бірюзове сяйво й спокійна технічна сітка. */
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(0, 229, 255, 0.12), transparent 70%),
    radial-gradient(circle at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.6) 100%),
    var(--auth-bg);
}

/* Шар 1 — технічна сітка, згасає до країв. */
body.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 65% 65% at 50% 44%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 65% 65% at 50% 44%, #000 25%, transparent 80%);
}

/* HUD-обрамлення: тонкі teal-кутики по краях екрана. */
html::after {
  content: '';
  position: fixed;
  inset: 20px;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--auth-accent), var(--auth-accent)) 0 0 / 22px 1px no-repeat,
    linear-gradient(var(--auth-accent), var(--auth-accent)) 0 0 / 1px 22px no-repeat,
    linear-gradient(var(--auth-accent), var(--auth-accent)) 100% 0 / 22px 1px no-repeat,
    linear-gradient(var(--auth-accent), var(--auth-accent)) 100% 0 / 1px 22px no-repeat,
    linear-gradient(var(--auth-accent), var(--auth-accent)) 0 100% / 22px 1px no-repeat,
    linear-gradient(var(--auth-accent), var(--auth-accent)) 0 100% / 1px 22px no-repeat,
    linear-gradient(var(--auth-accent), var(--auth-accent)) 100% 100% / 22px 1px no-repeat,
    linear-gradient(var(--auth-accent), var(--auth-accent)) 100% 100% / 1px 22px no-repeat;
  opacity: 0.3;
}

.auth-card {
  --auth-hex-cap: 110px;
  --auth-hex: polygon(50% 0, 100% var(--auth-hex-cap), 100% calc(100% - var(--auth-hex-cap)), 50% 100%, 0 calc(100% - var(--auth-hex-cap)), 0 var(--auth-hex-cap));
  position: relative;
  z-index: 1;
  isolation: isolate;
  flex: 0 0 auto;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 118px 104px 114px;
  width: 100%;
  max-width: 560px;
  min-height: 580px;
  overflow: visible;
}

/* Only the decorative shell is clipped; controls and focus rings stay intact. */
.auth-card::before,
.auth-card::after {
  content: '';
  position: absolute;
  clip-path: var(--auth-hex);
  pointer-events: none;
}

.auth-card::before {
  inset: 0;
  z-index: -2;
  background: linear-gradient(150deg, #8af3ff 0%, #00e5ff80 25%, #294752 55%, #00e5ff66 85%, #8af3ff 100%);
}

.auth-card::after {
  inset: 2px;
  z-index: -1;
  background: linear-gradient(155deg, #172832fa, #101a23fc 55%, #121e27fc);
}

.auth-card.auth-card--compact {
  max-width: 560px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  text-align: center;
}

.auth-logo {
  width: 144px;
  height: 144px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 20px rgba(0, 212, 170, 0.35));
}

/* A quiet product signature below the access shell. */
.auth-footer {
  position: relative;
  z-index: 1;
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  max-width: 100%;
  text-align: center;
  font-size: 0.65rem;
  line-height: 1.7;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--auth-muted);
  opacity: 0.85;
}

.auth-footer::before {
  content: '';
  flex: 0 0 6px;
  width: 6px;
  height: 7px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--auth-accent);
}

.auth-title {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.65rem;
}

.auth-subtitle {
  color: var(--auth-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.auth-form label,
.auth-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  color: #bbced9;
  margin-bottom: 0.5rem;
}

.auth-form input {
  width: 100%;
  min-height: 54px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  background: #0b151e;
  border: 1px solid var(--auth-border);
  color: var(--auth-text);
  padding: 0.85rem 1rem;
  border-radius: var(--auth-radius);
  margin-bottom: 1.25rem;
}

.auth-form input::placeholder { color: #8da2af; opacity: 1; }
.auth-form input:focus {
  outline: 2px solid #00e5ff33;
  outline-offset: 2px;
  border-color: var(--auth-accent);
}

.auth-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid var(--auth-alert);
  color: var(--auth-alert);
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--auth-radius);
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}

.auth-btn {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  min-height: 54px;
  background: var(--auth-accent);
  color: #07171d;
  border: none;
  padding: 0.9rem 1rem;
  border-radius: var(--auth-radius);
  cursor: pointer;
}

.auth-btn:hover { background: var(--auth-accent-dim); }
.auth-btn:active { background: #00c9e3; }
.auth-btn:focus-visible,
.auth-btn-secondary:focus-visible,
.auth-back-link a:focus-visible { outline: 2px solid #d4fbff; outline-offset: 4px; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-btn-secondary {
  width: 100%;
  min-height: 48px;
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  color: var(--auth-accent);
  border: 1px solid var(--auth-accent);
  border-radius: var(--auth-radius);
  cursor: pointer;
}

.auth-btn-secondary:hover { background: rgba(0, 229, 255, 0.08); }
.auth-btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  color: var(--auth-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-divider span {
  background: var(--auth-card);
  padding: 0 0.5rem;
}

.auth-hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

.auth-back-link {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.auth-back-link a {
  color: var(--auth-muted);
  text-decoration: none;
}

.auth-back-link a:hover { color: var(--auth-accent); }

@media (max-width: 600px) {
  body.auth-page { padding: 1.5rem 1rem; }
  .auth-card,
  .auth-card.auth-card--compact {
    --auth-hex-cap: 64px;
    max-width: 420px;
    min-height: 0;
    padding: 76px clamp(24px, 8vw, 34px) 74px;
  }
  .auth-brand { gap: 1.25rem; margin-bottom: 1.5rem; }
  .auth-title { font-size: 1.3rem; }
  .auth-footer { font-size: 0.6rem; letter-spacing: 0.08em; }
}

/* UI/UX-аудит 15.11 (Claude): підпис поля вже каже «Пароль» — плейсхолдер прибрано;
   плейсхолдер — шрифтом інтерфейсу; футер не дрібніший за 11 px (В10, В11). */
.auth-form input::placeholder { font-family: "Inter", sans-serif; }
.auth-footer { font-size: 11px; }
/* На ≤ 360 px підпис 11 px у два рядки — вужчий за мережеві лінки з відступом 12 px. */
@media (max-width: 360px) { .auth-footer { letter-spacing: 0.04em; max-width: 230px; margin-left: auto; margin-right: auto; line-height: 1.45; } }
