/* =========================
   AUTH — glass / apple-ish
   ========================= */

/* fallback-токены (если в base.html их нет) */
:root{
  --accent-blue: var(--accent-blue, #1d4ed8);
  --accent-brown: var(--accent-brown, #8b5e3c);

  --ink: var(--ink, #ffffff);
  --bg: var(--bg, #0b0b0f);
  --muted: var(--muted, rgba(203,213,225,.92));

  --border: var(--border, rgba(255,255,255,.14));
  --glass-1: rgba(255,255,255,.06);
  --glass-2: rgba(255,255,255,.10);

  --shadow-lg: 0 18px 50px rgba(0,0,0,.55);
  --shadow-md: 0 12px 34px rgba(0,0,0,.40);

  --ring: rgba(56,189,248,.55);
  --ring-soft: rgba(56,189,248,.16);

  --danger: rgba(248,113,113,.95);
  --danger-soft: rgba(239,68,68,.10);
  --success: rgba(34,197,94,.9);

  --auth-maxw: 554px;
  --auth-radius: 22px;
}

/* На auth страницах фон не ловит клики */
.binary-bg,
.binary-sym{
  pointer-events: none !important;
}

.page-main{height: 81%;}

/* ===== Layout ===== */
.auth-wrap{
  max-width: var(--auth-maxw);
  margin: 0 auto;
  padding: 52px 16px 64px;
  position: relative;
  z-index: 50; /* форма поверх фона */
}

.auth-card{
  position: relative;
  border-radius: var(--auth-radius);
  border: 1px solid rgba(255,255,255,.12);

  background:
    radial-gradient(1200px 520px at 15% 0%, rgba(56,189,248,.12), transparent 55%),
    radial-gradient(900px 520px at 85% 10%, rgba(29,78,216,.16), transparent 60%),
    linear-gradient(180deg, var(--glass-1), rgba(255,255,255,.03));

  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  overflow: hidden;
  padding: 22px 20px 18px;
}

/* блик */
.auth-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  pointer-events:none;
  background:
    radial-gradient(600px 220px at 20% 0%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(600px 220px at 80% 0%, rgba(255,255,255,.08), transparent 62%);
  opacity: .9;
}

/* внутренняя рамка */
.auth-card::after{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: calc(var(--auth-radius) - 12px);
  border: 1px solid rgba(255,255,255,.06);
  pointer-events:none;
}

/* ===== Head ===== */
.auth-title{
  position: relative;
  z-index: 1;
  margin: 2px 0 8px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: .2px;
  color: var(--ink);
}

.auth-sub{
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: rgba(203,213,225,.92);
  font-size: 14px;
}


.pw-wrap{ position: relative; }
.pw-wrap input{ padding-right: 44px; }
.pw-eye{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  border:0; background:transparent; cursor:pointer;
  opacity:.75;
}
.pw-eye.is-on{ opacity:1; }


/* ===== Form ===== */
#regForm,
#loginForm,
#verifyForm{
  position: relative;
  z-index: 1;
}

.auth-field{
  margin: 0 0 14px;
}

.auth-field label{
  display:block;
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(203,213,225,.88);
  letter-spacing: .2px;
}

/* Inputs */
.auth-field input,
.auth-field textarea,
.auth-field select{
  width: 100%;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);

  background: linear-gradient(180deg, rgba(0,0,0,.26), rgba(0,0,0,.18));
  color: var(--ink);

  outline: none;
  box-shadow: var(--shadow-md);

  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    transform .12s ease,
    background .15s ease;
}

.auth-field input::placeholder,
.auth-field textarea::placeholder{
  color: rgba(203,213,225,.55);
}

.auth-field input:hover,
.auth-field textarea:hover,
.auth-field select:hover{
  border-color: rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.14));
}

/* focus */
.auth-field input:focus,
.auth-field textarea:focus,
.auth-field select:focus{
  border-color: rgba(56,189,248,.45);
  box-shadow:
    0 0 0 4px var(--ring-soft),
    0 0 0 1px rgba(56,189,248,.25) inset,
    var(--shadow-md);
  transform: translateY(-1px);
}

/* errors under fields */
.auth-err{
  margin-top: 8px;
  color: rgba(254,202,202,.98);
  font-size: 13px;
}

/* status */
.auth-status{
  margin-top: 12px;
  font-size: 13px;
  color: rgba(203,213,225,.85);
}
.auth-status.is-ok{ color: rgba(134,239,172,.95); }
.auth-status.is-bad{ color: rgba(254,202,202,.98); }

/* ===== Actions ===== */
.auth-actions{
  margin-top: 6px;
  display: grid;
  gap: 10px;
}

.auth-btn{
  width: 100%;
  display: inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;

  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;

  color: #fff;
  font-weight: 650;
  letter-spacing: .2px;

  background:
    radial-gradient(900px 220px at 20% 20%, rgba(56,189,248,.35), transparent 52%),
    linear-gradient(90deg, rgba(29,78,216,.85), rgba(11,18,40,.85));

  box-shadow:
    0 14px 38px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.06) inset;

  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}

.auth-btn:hover{
  transform: translateY(-1px);
  box-shadow:
    0 18px 46px rgba(0,0,0,.55),
    0 0 0 4px rgba(56,189,248,.12),
    0 0 0 1px rgba(255,255,255,.08) inset;
  filter: saturate(1.08);
}

.auth-btn:active{
  transform: translateY(0);
  box-shadow:
    0 10px 26px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.06) inset;
}

.auth-btn:focus{ outline: none; }
.auth-btn:focus-visible{
  box-shadow:
    0 18px 46px rgba(0,0,0,.55),
    0 0 0 4px rgba(56,189,248,.18),
    0 0 0 1px rgba(56,189,248,.30) inset;
}

/* links */
.auth-link{
  color: rgba(147,197,253,.95);
  text-decoration: none;
  font-size: 13px;
  text-align: center;
}
.auth-link:hover{ text-decoration: underline; }

/* ===== Team size grid ===== */
.choice-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 560px){
  .choice-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* choice buttons */
.choice-btn{
  position: relative;
  width: 100%;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);

  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  color: rgba(255,255,255,.92);

  cursor: pointer;
  user-select: none;

  box-shadow:
    0 10px 26px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.04) inset;

  transition: transform .10s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease, filter .15s ease;
}

.choice-btn::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events:none;
  background: radial-gradient(220px 110px at 30% 15%, rgba(255,255,255,.12), transparent 60%);
  opacity: .8;
}

.choice-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  filter: saturate(1.03);
}

/* active */
.choice-btn.is-active{
  border-color: rgba(56,189,248,.55);
  background:
    radial-gradient(520px 180px at 30% 30%, rgba(56,189,248,.22), transparent 55%),
    linear-gradient(180deg, rgba(29,78,216,.20), rgba(0,0,0,.10));
  box-shadow:
    0 14px 32px rgba(0,0,0,.42),
    0 0 0 4px rgba(56,189,248,.14),
    0 0 0 1px rgba(56,189,248,.22) inset;
}

.choice-btn:focus{ outline: none; }
.choice-btn:focus-visible{
  border-color: rgba(56,189,248,.65);
  box-shadow:
    0 14px 32px rgba(0,0,0,.42),
    0 0 0 4px rgba(56,189,248,.18),
    0 0 0 1px rgba(56,189,248,.28) inset;
}


/* ===== Agreement step ===== */
.terms-title{
  font-size: 13px;
  color: rgba(203,213,225,.88);
  letter-spacing: .2px;
}

.terms-box{
  height: 280px;
  overflow: auto;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(0,0,0,.26), rgba(0,0,0,.18));
  box-shadow: var(--shadow-md);
  -webkit-overflow-scrolling: touch; /* iOS */
}

.terms-box:focus{
  outline: none;
  border-color: rgba(56,189,248,.45);
  box-shadow: 0 0 0 4px var(--ring-soft), 0 0 0 1px rgba(56,189,248,.25) inset, var(--shadow-md);
}

.terms-check{
  display:flex !important;
  gap:10px;
  align-items:flex-start;
  user-select:none;
  color: rgba(203,213,225,.92);
  font-size: 13px;
}

.terms-check input{
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #38bdf8; /* синий */
}

/* Scrollbar (Chrome/Edge/Safari desktop) */
.terms-box::-webkit-scrollbar{ width: 10px; }
.terms-box::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}
.terms-box::-webkit-scrollbar-thumb{
  background: rgba(56,189,248,.55);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.25);
}
.terms-box::-webkit-scrollbar-thumb:hover{
  background: rgba(56,189,248,.75);
}

/* Scrollbar (Firefox) */
.terms-box{
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.65) rgba(255,255,255,.06);
}



/* ===== Small screens ===== */
@media (max-width: 420px){
  .auth-wrap{ padding: 34px 14px 54px; }
  .auth-card{ padding: 18px 16px 14px; border-radius: 20px; }
  .auth-title{ font-size: 22px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce){
  .auth-field input,
  .auth-field textarea,
  .auth-field select,
  .auth-btn,
  .choice-btn{
    transition: none !important;
  }
}
