/* ============================================================
   Login / Auth view — Vui Cùng World Cup
   Shared by participant + admin. Same dark sporty system.
   ============================================================ */

.auth {
  position: fixed; inset: 0; z-index: 5;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(224,56,59,.16), transparent 58%),
    radial-gradient(820px 460px at 92% 108%, rgba(74,140,255,.12), transparent 58%),
    var(--bg);
  overflow: auto;
  max-width: 100vw;
}

/* ---------- left: brand / teaser ---------- */
.auth-brand {
  position: relative; overflow: hidden;
  padding: 54px 56px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(224,56,59,.14), transparent 60%),
    linear-gradient(180deg, #131620, #0c0d12);
  min-width: 0;
}
.auth-brand::after {
  content: ''; position: absolute; right: -90px; bottom: -90px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(224,56,59,.18), transparent 70%);
  pointer-events: none;
}
.auth-logo { display: flex; align-items: center; gap: 14px; min-width: 0; }
.auth-logo .mark {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--red-hi), var(--red-deep));
  box-shadow: var(--glow-red);
}
.auth-logo .mark svg { width: 28px; height: 28px; }
.auth-logo .wm { font-family: var(--font-disp); font-weight: 700; font-size: 26px; line-height: 1; white-space: nowrap; }
.auth-logo .wm span { color: var(--red-hi); }
.auth-logo .sub { font-size: 11.5px; color: var(--txt-3); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }

.auth-hero { margin: auto 0; max-width: 440px; min-width: 0; }
.auth-hero .kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red-hi); }
.auth-hero h2 { font-family: var(--font-disp); font-weight: 700; font-size: 46px; line-height: 1; margin: 14px 0 16px; letter-spacing: .01em; }
.auth-hero p { font-size: 15px; color: var(--txt-2); line-height: 1.6; max-width: 400px; }

/* teaser stat row */
.auth-teasers { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.auth-teaser {
  flex: 1; min-width: 120px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px;
}
.auth-teaser .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 10px; }
.auth-teaser .v { font-family: var(--font-num); font-weight: 800; font-size: 24px; line-height: 1; }
.auth-teaser .k { font-size: 11.5px; color: var(--txt-3); margin-top: 4px; }

/* upcoming-match teaser chip */
.auth-match {
  margin-top: 16px; display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 16px;
  min-width: 0;
}
.auth-match .vs { display: flex; align-items: center; gap: 8px; font-family: var(--font-disp); font-weight: 700; font-size: 17px; min-width: 0; }
.auth-match .meta { margin-left: auto; text-align: right; }
.auth-match .meta .t { font-size: 11px; color: var(--txt-3); }
.auth-match .meta .l { font-family: var(--font-num); font-weight: 700; font-size: 13px; color: var(--gold); }

.auth-foot { margin-top: 36px; font-size: 12px; color: var(--txt-3); }

/* ---------- right: form panel ---------- */
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 40px; min-width: 0; }
.auth-card {
  width: 100%; max-width: 408px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop); padding: 34px 34px 30px;
  animation: fadeUp .4s var(--ease);
  min-width: 0;
}
.auth-card .role-tabs { display: flex; gap: 6px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; }
.auth-card .role-tabs .rt {
  flex: 1; text-align: center; padding: 9px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--txt-2); display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: .15s;
  min-width: 0;
}
.auth-card .role-tabs .rt:hover { color: var(--txt); }
.auth-card .role-tabs .rt.on { background: var(--raise); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.auth-card .role-tabs .rt svg { width: 15px; height: 15px; }

.auth-h { margin-bottom: 22px; }
.auth-h .t { font-family: var(--font-disp); font-weight: 700; font-size: 28px; line-height: 1; }
.auth-h .d { font-size: 13px; color: var(--txt-3); margin-top: 7px; line-height: 1.5; }

/* inputs */
.auth-field { margin-bottom: 15px; }
.auth-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--txt-2); margin-bottom: 7px; }
.auth-inp {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1.5px solid var(--line-2); border-radius: 11px; padding: 0 13px;
  transition: border-color .15s, box-shadow .15s;
}
.auth-inp:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224,56,59,.12); }
.auth-inp.invalid { border-color: var(--neg); box-shadow: 0 0 0 3px rgba(255,93,93,.1); }
.auth-inp svg { width: 17px; height: 17px; color: var(--txt-3); flex: none; }
.auth-inp input {
  flex: 1; background: none; border: none; outline: none; color: var(--txt);
  font-family: var(--font-body); font-size: 14.5px; padding: 13px 0;
  min-width: 0;
}
.auth-inp input::placeholder { color: var(--txt-3); }
.auth-inp .toggle-pw { cursor: pointer; color: var(--txt-3); }
.auth-inp .toggle-pw:hover { color: var(--txt-2); }

/* row: remember + forgot */
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 20px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--txt-2); user-select: none; }
.check .box {
  width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--bg-2);
  display: grid; place-items: center; transition: .15s; flex: none;
}
.check .box svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.check.on .box { background: var(--red); border-color: var(--red); }
.check.on .box svg { opacity: 1; }
.auth-link { font-size: 13px; font-weight: 600; color: var(--txt-2); cursor: pointer; }
.auth-link:hover { color: var(--red-hi); }

/* alert banner (error / inactive) */
.auth-alert {
  display: flex; align-items: flex-start; gap: 11px;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 18px;
  font-size: 13px; line-height: 1.45;
  animation: fadeUp .25s var(--ease);
}
.auth-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.auth-alert .at { font-weight: 700; }
.auth-alert.err { background: rgba(255,93,93,.1); border: 1px solid rgba(255,93,93,.3); color: #ffb3b3; }
.auth-alert.err svg { color: var(--neg); }
.auth-alert.warn { background: rgba(242,179,57,.09); border: 1px solid rgba(242,179,57,.3); color: #f3d089; }
.auth-alert.warn svg { color: var(--gold); }

/* helper foot */
.auth-helper { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--txt-3); line-height: 1.6; }
.auth-helper b { color: var(--txt-2); font-weight: 600; }
.auth-note { margin-top: 12px; font-size: 11.5px; color: var(--txt-3); text-align: center; display: flex; align-items: center; justify-content: center; gap: 7px; }
.auth-note svg { width: 14px; height: 14px; color: var(--steel); }

/* spinner */
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- access denied card ---------- */
.denied-wrap { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 480px at 50% -10%, rgba(224,56,59,.12), transparent 60%), var(--bg); }
.denied {
  width: 100%; max-width: 440px; text-align: center;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop); padding: 40px 36px 32px; animation: fadeUp .35s var(--ease);
}
.denied .badge-ic {
  width: 66px; height: 66px; border-radius: 18px; margin: 0 auto 20px; display: grid; place-items: center;
  background: rgba(255,93,93,.12); border: 1px solid rgba(255,93,93,.3);
}
.denied .badge-ic svg { width: 32px; height: 32px; color: var(--neg); }
.denied h2 { font-family: var(--font-disp); font-weight: 700; font-size: 26px; }
.denied p { font-size: 14px; color: var(--txt-2); line-height: 1.6; margin: 10px 0 24px; }
.denied .acts { display: flex; gap: 10px; }

/* ---------- demo state switcher (prototype only) ---------- */
.state-switch {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: rgba(20,22,28,.92); backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); border-radius: 14px; padding: 8px 10px;
  box-shadow: var(--shadow-pop); max-width: calc(100vw - 24px);
}
.state-switch .lbl { font-size: 10.5px; color: var(--txt-3); text-transform: uppercase; letter-spacing: .08em; padding: 0 6px; }
.state-switch .ss {
  font-size: 12px; font-weight: 600; color: var(--txt-2); cursor: pointer;
  padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
.state-switch .ss:hover { color: #fff; border-color: var(--line-2); }
.state-switch .ss.on { background: var(--red); color: #fff; border-color: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { border-right: none; border-bottom: 1px solid var(--line); padding: 30px 26px 26px; }
  .auth-brand::after { display: none; }
  .auth-hero { margin: 18px 0 4px; }
  .auth-hero h2 { font-size: 32px; }
  .auth-hero p { font-size: 13.5px; }
  .auth-teasers { margin-top: 20px; }
  .auth-match { display: none; }
  .auth-panel { padding: 28px 20px 90px; }
  .auth-foot { display: none; }
}
@media (max-width: 480px) {
  .auth-brand { padding: 24px 18px 22px; }
  .auth-logo .mark { width: 46px; height: 46px; border-radius: 12px; }
  .auth-logo .wm { font-size: 22px; }
  .auth-hero h2 { font-size: 28px; }
  .auth-card { padding: 26px 22px 24px; border-radius: var(--r-lg); }
  .auth-teaser { min-width: 0; }
  .auth-teasers { gap: 8px; }
  .auth-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .auth-card .role-tabs .rt { font-size: 12px; gap: 5px; padding-inline: 6px; }
  .auth-panel { padding-inline: 16px; }
}

/* ---------- MVC form integration ---------- */
.auth-card .role-tabs input,
.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-validation {
  display: block;
  min-height: 16px;
  font-size: 11.5px;
  color: var(--neg);
  margin-top: 6px;
}

.auth-validation:empty {
  display: none;
}

.toggle-pw {
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  padding: 0;
}
