/* =============================================================================
   login.php (auth-page) styles — relocated verbatim from the inline <style>
   block 2026-09-08. Standalone public page; loads only this + theme.css.
   ========================================================================== */
    @font-face {
      font-family: "InterVar";
      src: url("../../fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
      font-weight: 100 900;
      font-style: normal;
      font-display: swap;
    }

    :root {
      --txt-dark: #f5f7fb;
      --txt-mid: rgba(232, 236, 244, 0.72);
      --focus: #7aa6ff;
      --ring: rgba(122, 166, 255, 0.22);
      --err-bg: #fdeeee;
      --err-line: #f3c8c8;
      --err-txt: #b62323;
      --motion: 280ms ease;
      --glow: rgba(73, 121, 255, 0.5);
    }

    * { box-sizing: border-box; }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    body {
      margin: 0;
      min-height: 100vh;
      min-height: 100svh;
      font-family: "InterVar", "Avenir Next", "Segoe UI", sans-serif;
      background: #05070d;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      /* Let the background establish the page before the brand and form.
         The clamp keeps the composition intentional across desktop sizes. */
      padding: clamp(86px, 13svh, 144px) 16px 24px;
      position: relative;
      overflow-x: hidden;
      overflow-y: auto;
      overflow-anchor: none;
    }

    body::before,
    body::after {
      content: "";
      position: fixed;
      pointer-events: none;
      z-index: 0;
      mix-blend-mode: screen;
      opacity: 0.24;
    }

    body::before {
      width: 700px;
      height: 180px;
      left: -180px;
      top: 40px;
      background: linear-gradient(95deg, rgba(70, 230, 255, 0.32) 0%, rgba(78, 149, 255, 0.22) 48%, rgba(113, 86, 255, 0) 100%);
      filter: blur(10px);
      transform: rotate(42deg);
    }

    body::after {
      width: 520px;
      height: 140px;
      right: -120px;
      bottom: 20px;
      background: linear-gradient(105deg, rgba(93, 183, 255, 0.2) 0%, rgba(120, 96, 255, 0.18) 58%, rgba(120, 96, 255, 0) 100%);
      filter: blur(16px);
      transform: rotate(28deg);
    }

    .video-shell {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      overflow: hidden;
    }

    .video-shell img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      transform: scale(1.045);
      filter: saturate(0.72) contrast(1.08) brightness(0.30) blur(2px);
    }

    .video-shell::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        radial-gradient(900px 520px at 50% 0%, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.38) 55%, rgba(0, 0, 0, 0.88) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(2, 3, 7, 0.78) 100%);
    }

    .video-shell::after {
      content: "";
      position: absolute;
      inset: 0;
      background-image: radial-gradient(rgba(255, 255, 255, 0.13) 0.7px, transparent 0.8px);
      background-size: 16px 16px;
      opacity: 0.16;
      mix-blend-mode: screen;
    }

    .top-logo {
      position: relative;
      z-index: 2;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin: 0 0 32px;
      filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
    }

    .top-logo img {
      width: min(340px, 72vw);
      height: auto;
      display: block;
      filter: brightness(0) invert(1);
      opacity: 0.98;
    }

    .top-logo__claim {
      margin-top: 12px;
      color: rgba(240, 243, 250, 0.58);
      font-size: 11px;
      font-weight: 520;
      letter-spacing: 0.14em;
      text-transform: uppercase;
    }

    .auth-stage {
      width: min(440px, 100%);
      flex: 0 0 auto;
      position: relative;
      z-index: 1;
      perspective: 1600px;
      transition: height 1100ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    .auth-shell {
      width: 100%;
      height: 100%;
      min-height: 0;
      border-radius: 20px;
      position: relative;
      transform-style: preserve-3d;
      transform: rotateY(0deg) translateZ(0);
      transition:
        transform 1100ms cubic-bezier(0.16, 1, 0.3, 1);
      will-change: transform;
    }

    .auth-shell::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      padding: 1px;
      background: linear-gradient(145deg, rgba(255, 255, 255, 0.10), rgba(122, 166, 255, 0.02) 30%, rgba(255, 255, 255, 0.01) 60%, rgba(255, 255, 255, 0.04));
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none;
      display: none;
    }

    .auth-shell::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background:
        radial-gradient(420px 180px at 18% 0%, rgba(122, 166, 255, 0.06) 0%, rgba(122, 166, 255, 0) 68%),
        radial-gradient(420px 240px at 100% 0%, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 48%);
      pointer-events: none;
      mix-blend-mode: screen;
      opacity: 0;
      display: none;
      transition: opacity 350ms ease;
    }

    .auth-inner {
      position: relative;
      width: 100%;
      height: 100%;
      transform-style: preserve-3d;
    }

    .auth-shell.is-demo {
      transform: rotateY(180deg) translateZ(0);
    }

    .auth-shell.is-transitioning::after {
      animation: card-sheen 1100ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes card-sheen {
      0%, 100% { opacity: 0.35; }
      42% { opacity: 0.82; }
      58% { opacity: 0.58; }
    }

    .auth-face {
      position: absolute;
      top: 0;
      right: 0;
      bottom: auto;
      left: 0;
      height: auto;
      min-height: 0;
      transform-origin: 50% 50%;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      border-radius: 20px;
      border: 1px solid rgba(255, 255, 255, 0.11);
      background:
        radial-gradient(420px 180px at 18% 0%, rgba(122, 166, 255, 0.055) 0%, rgba(122, 166, 255, 0) 68%),
        linear-gradient(180deg, rgba(10, 11, 16, 0.88) 0%, rgba(5, 6, 10, 0.96) 100%);
      box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.50),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      overflow: hidden;
    }

    .auth-front {
      transform: rotateY(0deg) translateZ(1px);
    }

    .auth-back {
      transform: rotateY(180deg) translateZ(1px);
      pointer-events: none;
      box-shadow:
        -30px 30px 70px rgba(0, 0, 0, 0.58),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
    }

    .auth-shell.is-demo .auth-front {
      pointer-events: none;
    }

    .auth-shell.is-demo .auth-back {
      pointer-events: auto;
    }

    .pane {
      padding: 32px;
      position: absolute;
      z-index: 1;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
    }

    .pane-title {
      margin: 0;
      font-size: clamp(23px, 4.8vw, 28px);
      line-height: 1.05;
      letter-spacing: -0.04em;
      font-weight: 820;
      color: var(--txt-dark);
    }

    .pane-head {
      min-height: 23px;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .pane-head .pane-title { margin: 0; }

    .pane-subtitle {
      margin: 0 0 24px;
      color: rgba(232, 236, 244, 0.62);
      font-size: 12px;
      line-height: 1.5;
    }

    .back-link {
      border: 0;
      padding: 4px 0;
      background: transparent;
      color: rgba(232, 236, 244, 0.62);
      font: inherit;
      font-size: 10px;
      font-weight: 650;
      cursor: pointer;
      transition: color var(--motion), transform var(--motion);
    }

    .back-link:hover,
    .back-link:focus-visible {
      color: #fff;
      outline: none;
      transform: translateX(-2px);
    }

    .demo-field-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 142px;
      gap: 12px;
    }

    .demo-field-row .field { margin-bottom: 14px; }

    @media (prefers-reduced-motion: reduce) {
      .auth-shell,
      .auth-stage { transition-duration: 1ms; }
      .auth-shell.is-transitioning::after { animation-duration: 1ms; }
    }

    .portal-transition {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: grid;
      place-items: center;
      overflow: hidden;
      pointer-events: none;
      opacity: 0;
      background:
        radial-gradient(circle at 50% 45%, rgba(53, 76, 180, 0.20), transparent 32%),
        #05060a;
      transition: opacity 520ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    .portal-transition::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      width: 22%;
      left: -30%;
      transform: skewX(-12deg);
      background: linear-gradient(90deg, transparent, rgba(117, 145, 255, 0.16), transparent);
      filter: blur(12px);
    }

    .portal-transition__mark {
      width: min(330px, 64vw);
      opacity: 0;
      transform: translateY(8px) scale(0.94);
      filter: brightness(0) invert(1) drop-shadow(0 0 28px rgba(104, 128, 255, 0.26));
      transition: opacity 420ms 260ms ease, transform 760ms 180ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    body.is-auth-leaving .portal-transition {
      opacity: 1;
    }

    body.is-auth-leaving .portal-transition::before {
      animation: portalSweep 900ms 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    body.is-auth-leaving .portal-transition__mark {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    body.is-auth-leaving .auth-stage,
    body.is-auth-leaving .top-logo {
      transform: scale(0.94) translateY(-8px);
      opacity: 0;
      transition: transform 620ms cubic-bezier(0.16, 1, 0.3, 1), opacity 320ms ease;
    }

    @keyframes portalSweep {
      to { left: 110%; }
    }

    @media (prefers-reduced-motion: reduce) {
      .portal-transition { transition-duration: 120ms; }
      body.is-auth-leaving .portal-transition::before { animation: none; }
    }

    .label {
      display: block;
      margin-bottom: 5px;
      font-size: 9px;
      font-weight: 760;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.68);
    }

    .field {
      width: 100%;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.09);
      min-height: 52px;
      padding: 12px 14px;
      font-size: 13px;
      margin-bottom: 14px;
      background: linear-gradient(180deg, rgba(6, 7, 11, 0.96) 0%, rgba(12, 13, 18, 0.94) 100%);
      color: #f6f7fb;
      backdrop-filter: blur(12px);
      transition: border-color var(--motion), box-shadow var(--motion), transform var(--motion);
      box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 8px 18px rgba(0, 0, 0, 0.14);
    }

    .field::placeholder { color: rgba(246, 247, 251, 0.4); }

    select.field {
      appearance: none;
      cursor: pointer;
      color-scheme: dark;
      background-image:
        linear-gradient(45deg, transparent 50%, rgba(246, 247, 251, 0.55) 50%),
        linear-gradient(135deg, rgba(246, 247, 251, 0.55) 50%, transparent 50%),
        linear-gradient(180deg, rgba(8, 9, 13, 0.96) 0%, rgba(18, 19, 25, 0.9) 100%);
      background-position: calc(100% - 17px) 18px, calc(100% - 13px) 18px, 0 0;
      background-size: 4px 4px, 4px 4px, 100% 100%;
      background-repeat: no-repeat;
      padding-right: 34px;
    }

    body.auth-page select.field option,
    body.auth-page select.field optgroup {
      background: #0d1017;
      color: #f1f4fb;
      font-family: "InterVar", "Avenir Next", "Segoe UI", sans-serif;
    }

    body.auth-page select.field option:disabled {
      color: rgba(224, 229, 240, 0.46);
    }

    body.auth-page select.field option:checked {
      background: #171b25 linear-gradient(0deg, #171b25 0%, #171b25 100%);
      color: #f7f9ff;
    }

    body.auth-page select.field option:checked:disabled {
      background: #171b25 linear-gradient(0deg, #171b25 0%, #171b25 100%);
      color: rgba(224, 229, 240, 0.62);
    }

    .field:focus-visible,
    .btn:focus-visible,
    .pw-toggle:focus-visible {
      outline: none;
      border-color: var(--focus);
      box-shadow: 0 0 0 4px var(--ring);
    }

    .pw-wrap { position: relative; }

    .input-wrap { position: relative; }
    .input-wrap .field { padding-left: 44px; }
    .pw-wrap .field { padding-right: 46px; }

    .field-icon {
      position: absolute;
      z-index: 2;
      top: 26px;
      left: 15px;
      width: 17px;
      height: 17px;
      color: rgba(224, 229, 240, 0.48);
      transform: translateY(-50%);
      pointer-events: none;
    }

    .pw-toggle {
      position: absolute;
      top: 26px;
      right: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 0;
      width: 22px;
      height: 22px;
      padding: 0;
      font-size: 0;
      cursor: pointer;
      background: transparent;
      color: rgba(240, 244, 255, 0.82);
      box-shadow: none;
      transform: translateY(-50%);
    }

    .pw-toggle::before {
      content: "👁";
      font-size: 15px;
      line-height: 1;
    }

    .pw-toggle.is-visible::before {
      content: "🙈";
      font-size: 15px;
    }

    .pw-toggle::before { display: none; }
    .pw-toggle svg { width: 16px; height: 16px; display: block; }
    .pw-toggle .eye-off { display: none; }
    .pw-toggle.is-visible .eye-on { display: none; }
    .pw-toggle.is-visible .eye-off { display: block; }

    .btn {
      border: 0;
      border-radius: 12px;
      min-height: 50px;
      padding: 0 12px;
      width: 100%;
      font-size: 11px;
      font-weight: 760;
      letter-spacing: 0.03em;
      cursor: pointer;
      transition: transform var(--motion), filter var(--motion), box-shadow var(--motion);
      background: linear-gradient(180deg, #3F63FF 0%, #2946C8 100%);
      color: #fff;
      box-shadow: 0 8px 18px rgba(24, 45, 139, 0.24), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
    }

    .btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 10px 22px rgba(24, 45, 139, 0.28); }

    .btn-link {
      display: flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
    }

    .btn-secondary {
      margin-top: 10px;
      border: 1px solid rgba(255, 255, 255, 0.11);
      background: rgba(255, 255, 255, 0.035);
      color: rgba(238, 241, 248, 0.78);
      box-shadow: none;
    }

    .btn-secondary:hover {
      border-color: rgba(255, 255, 255, 0.18);
      background: rgba(255, 255, 255, 0.06);
      color: #fff;
      box-shadow: none;
    }

    .login-options {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin: -2px 0 18px;
      font-size: 11px;
      color: var(--txt-mid);
    }

    .remember-control {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
    }

    .remember-control input {
      width: 15px;
      height: 15px;
      margin: 0;
      accent-color: #3f63ff;
    }

    .login-options a { color: rgba(167, 183, 255, 0.86); text-decoration: none; }
    .login-options a:hover { color: #fff; }

    .msg {
      margin: 0 0 8px;
      border-radius: 9px;
      padding: 8px 10px;
      font-size: 11px;
      line-height: 1.45;
    }

    .msg.error { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err-txt); }

    .msg.success {
      background: rgba(55, 184, 118, 0.1);
      border: 1px solid rgba(79, 207, 142, 0.24);
      color: #b9f4d5;
    }

    .help {
      margin-top: 12px;
      font-size: 10px;
      color: var(--txt-mid);
    }

    .help a {
      color: inherit;
      text-decoration: none;
    }

    .demo-sep {
      margin: 20px 0 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      color: rgba(255, 255, 255, 0.32);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 0.12em;
    }

    .demo-sep::before,
    .demo-sep::after {
      content: "";
      height: 1px;
      flex: 1;
      background: rgba(255, 255, 255, 0.1);
    }

    .demo-sep + .btn-secondary { margin-top: 0; }

    .login-footer {
      position: relative;
      z-index: 1;
      margin-top: 22px;
      text-align: center;
      color: rgba(226, 231, 241, 0.42);
      font-size: 9px;
      line-height: 1.7;
    }

    .login-footer p { margin: 0; }
    .login-footer a { color: inherit; text-decoration: none; }
    .login-footer a:hover { color: rgba(255, 255, 255, 0.72); }

    @media (max-width: 520px) {
      body {
        padding: max(clamp(48px, 9svh, 76px), env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom));
        justify-content: flex-start;
      }
      .top-logo { margin-bottom: 24px; }
      .top-logo img { width: min(260px, 76vw); }
      .top-logo__claim { margin-top: 9px; font-size: 9px; letter-spacing: 0.11em; }
      .auth-shell { border-radius: 18px; }
      .auth-face { border-radius: 18px; }
      .pane { padding: 22px 18px; }
      .field {
        font-size: 16px;
        min-height: 50px;
      }
      .field-icon,
      .pw-toggle { top: 25px; }
      .btn { min-height: 48px; }
      .login-options { font-size: 10px; }
      .login-footer { margin-top: 16px; }
      .demo-field-row { grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; }
    }

    @media (min-width: 521px) and (max-height: 760px) {
      body {
        padding-top: 52px;
      }
    }
