:root {
      --bg-900: #050a18;
      --bg-800: #0a1228;
      --bg-glow-1: rgba(22, 58, 137, 0.52);
      --bg-glow-2: rgba(12, 46, 108, 0.4);
      --panel-700: #111b37;
      --panel-600: #162244;
      --line-500: #22458a;
      --text-100: #edf2ff;
      --text-300: #a8b6d8;
      --accent-400: #2f7ef8;
      --accent-300: #58b2ff;
      --ok-400: #2ac181;
      --danger-400: #ff6a8a;
      --warn-400: #f4c259;
    }

    html[data-theme="light"] {
      --bg-900: #f8fafc;
      --bg-800: #f8fafc;
      --bg-glow-1: rgba(37, 99, 235, 0.08);
      --bg-glow-2: rgba(14, 165, 233, 0.06);
      --panel-700: #ffffff;
      --panel-600: #ffffff;
      --line-500: #e2e8f0;
      --text-100: #0f172a;
      --text-300: #64748b;
      --accent-400: #2563eb;
      --accent-300: #1d4ed8;
      --ok-400: #10b981;
      --danger-400: #ef4444;
      --warn-400: #d97706;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: "Plus Jakarta Sans", sans-serif;
      color: var(--text-100);
      background:
        radial-gradient(860px 420px at 10% -14%, var(--bg-glow-1) 0%, transparent 62%),
        radial-gradient(780px 360px at 100% -4%, var(--bg-glow-2) 0%, transparent 58%),
        linear-gradient(160deg, var(--bg-900), var(--bg-800));
      display: grid;
      place-items: center;
      padding: 24px;
      transition: background 180ms ease, color 150ms ease;
    }

    .auth-theme-toggle {
      position: fixed;
      right: clamp(14px, calc((100vw - 1060px) / 2 + 12px), 40px);
      top: 18px;
      z-index: 20;
      border: 1px solid rgba(97, 157, 246, 0.35);
      background: rgba(16, 30, 62, 0.84);
      color: #e8f1ff;
      border-radius: 999px;
      padding: 8px 13px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      cursor: pointer;
      box-shadow: 0 8px 18px rgba(8, 20, 46, 0.24);
      transition: border-color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
    }

    .auth-theme-toggle::before {
      content: "";
      width: 13px;
      height: 13px;
      border-radius: 50%;
      border: 2px solid currentColor;
      box-shadow: -3px 0 0 0 rgba(16, 30, 62, 0.84) inset;
      flex: 0 0 13px;
    }

    .auth-theme-toggle:hover {
      transform: translateY(-1px);
      border-color: rgba(138, 184, 255, 0.65);
    }

    .auth-theme-toggle:focus-visible {
      outline: none;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

    html[data-theme="light"] .auth-theme-toggle {
      border-color: #e2e8f0;
      background: #ffffff;
      color: #334155;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    }

    html[data-theme="light"] .auth-theme-toggle::before {
      border: 0;
      background: #f59e0b;
      box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.24);
    }

    .auth-shell {
      width: min(1060px, 100%);
      border: 1px solid rgba(74, 122, 220, 0.25);
      border-radius: 18px;
      overflow: hidden;
      background: linear-gradient(180deg, rgba(17, 27, 55, 0.92), rgba(10, 17, 35, 0.95));
      box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(105, 145, 227, 0.18);
      display: grid;
      grid-template-columns: 1.08fr 0.92fr;
      min-height: 620px;
    }

    .hero {
      padding: 48px 42px;
      background:
        radial-gradient(420px 220px at 18% 12%, rgba(69, 134, 255, 0.22), transparent 75%),
        radial-gradient(480px 220px at 85% 78%, rgba(45, 104, 240, 0.2), transparent 80%),
        linear-gradient(180deg, rgba(17, 33, 73, 0.95), rgba(11, 20, 44, 0.95));
      border-right: 1px solid rgba(74, 122, 220, 0.25);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 800;
      font-size: 36px;
      letter-spacing: 0.5px;
    }

    .logo {
      width: 46px;
      height: 46px;
      border-radius: 12px;
      border: 1px solid rgba(88, 178, 255, 0.5);
      display: block;
      background: #ffffff url("../img/aarveta-logo.png?v=20260512a") center / contain no-repeat;
    }

    .hero h1 {
      margin: 30px 0 14px;
      font-size: clamp(2.25rem, 4.2vw, 3.4rem);
      line-height: 1.08;
      letter-spacing: 0.2px;
    }

    .hero p {
      margin: 0;
      color: var(--text-300);
      max-width: 420px;
      line-height: 1.7;
      font-size: 16px;
    }

    .feature-grid {
      margin-top: 30px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .feature {
      border: 1px solid rgba(74, 122, 220, 0.24);
      border-radius: 12px;
      padding: 13px;
      background: linear-gradient(180deg, rgba(21, 35, 75, 0.55), rgba(13, 23, 49, 0.55));
    }

    .feature strong {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 18px;
      margin-bottom: 5px;
      line-height: 1.2;
    }

    .feature-icon {
      width: 24px;
      height: 24px;
      border-radius: 8px;
      border: 1px solid rgba(125, 170, 248, 0.45);
      display: inline-grid;
      place-items: center;
      font-size: 10px;
      letter-spacing: 0.02em;
      background: rgba(26, 56, 115, 0.35);
    }

    .feature span {
      color: var(--text-300);
      font-size: 13px;
    }

    .hero-note {
      margin-top: 30px;
      padding: 14px 16px;
      border: 1px solid rgba(244, 194, 89, 0.28);
      border-radius: 14px;
      background: rgba(101, 75, 22, 0.24);
      color: #f2d58d;
      font-size: 12px;
      line-height: 1.65;
    }

    .login-panel {
      padding: 50px 44px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .auth-tabs {
      display: inline-flex;
      gap: 8px;
      padding: 6px;
      border: 1px solid rgba(74, 122, 220, 0.24);
      border-radius: 14px;
      background: rgba(9, 15, 33, 0.48);
      margin-bottom: 18px;
      align-self: flex-start;
    }

    .auth-tab {
      text-decoration: none;
      color: var(--text-300);
      font-size: 13px;
      font-weight: 700;
      padding: 10px 14px;
      border-radius: 10px;
      transition: background 140ms ease, color 140ms ease, transform 120ms ease;
    }

    .auth-tab:hover {
      color: var(--text-100);
      transform: translateY(-1px);
    }

    .auth-tab.active {
      color: white;
      background: linear-gradient(145deg, rgba(47, 126, 248, 0.9), rgba(33, 95, 206, 0.9));
      box-shadow: 0 10px 22px rgba(32, 92, 207, 0.22);
    }

    .login-panel h2 {
      margin: 0 0 10px;
      font-size: 38px;
    }

    .sub {
      margin: 0 0 26px;
      color: var(--text-300);
      font-size: 15px;
      line-height: 1.65;
    }

    .panel-stack {
      display: grid;
      gap: 14px;
    }

    .section-card {
      border: 1px solid rgba(74, 122, 220, 0.24);
      border-radius: 16px;
      padding: 20px;
      background: linear-gradient(180deg, rgba(17, 27, 55, 0.78), rgba(10, 18, 38, 0.88));
    }

    .section-card h3 {
      margin: 0 0 6px;
      font-size: 18px;
    }

    .section-card p {
      margin: 0 0 14px;
      color: var(--text-300);
      font-size: 13px;
      line-height: 1.6;
    }

    .field {
      margin-bottom: 16px;
    }

    .field label,
    .field span {
      display: block;
      margin-bottom: 7px;
      font-size: 14px;
      color: #c4d1ef;
      font-weight: 600;
    }

    .field input,
    .field textarea {
      width: 100%;
      border: 1px solid #5b83ca;
      background: rgba(9, 15, 33, 0.75);
      color: var(--text-100);
      border-radius: 12px;
      padding: 14px 14px;
      outline: none;
      font-size: 15px;
      transition: border-color 140ms ease, box-shadow 140ms ease;
      resize: vertical;
      min-height: 50px;
    }

    .field input:focus,
    .field textarea:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

    .password-grid {
      display: grid;
      grid-template-columns: repeat(1, minmax(0, 1fr));
      gap: 12px;
    }

    .password-grid .field:last-child {
      grid-column: 1 / -1;
    }

    .btn {
      width: 100%;
      border: 1px solid transparent;
      background: var(--accent-400);
      color: white;
      font-weight: 700;
      border-radius: 12px;
      padding: 14px;
      min-height: 50px;
      font-size: 15px;
      cursor: pointer;
      box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
      transition: transform 120ms ease, background 120ms ease;
    }

    .btn:hover {
      transform: translateY(-1px);
      background: var(--accent-300);
    }

    .btn:disabled {
      opacity: 0.72;
      cursor: default;
      transform: none;
      filter: none;
    }

    .inline-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 6px;
    }

    .helper-link {
      color: #8dc3ff;
      text-decoration: none;
      font-size: 13px;
      font-weight: 600;
      white-space: nowrap;
    }

    .hint {
      margin-top: 14px;
      font-size: 12px;
      color: #9db1de;
      line-height: 1.6;
    }

    .hint .ok {
      color: var(--ok-400);
      font-weight: 700;
    }

    .message {
      margin-top: 10px;
      font-size: 13px;
      min-height: 18px;
    }

    .message.success {
      color: var(--ok-400);
    }

    .message.error {
      color: var(--danger-400);
    }

    .password-policy {
      margin: 10px 0 0;
      padding: 0;
      list-style: none;
      display: grid;
      gap: 6px;
      font-size: 12px;
      color: var(--text-300);
    }

    .password-policy li {
      display: flex;
      align-items: center;
      gap: 8px;
      line-height: 1.4;
    }

    .password-policy li::before {
      content: "\25CB";
      color: var(--text-300);
      font-size: 10px;
      flex: 0 0 auto;
    }

    .password-policy li.ok {
      color: var(--ok-400);
    }

    .password-policy li.ok::before {
      content: "\2713";
      color: var(--ok-400);
      font-size: 12px;
    }

    .token-preview {
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid rgba(88, 178, 255, 0.24);
      background: rgba(12, 22, 47, 0.76);
      color: #cfe4ff;
      display: none;
    }

    .token-preview.visible {
      display: block;
    }

    .token-preview code {
      display: block;
      margin-top: 6px;
      color: #8fd0ff;
      word-break: break-all;
      font-size: 12px;
      line-height: 1.6;
    }

    html[data-theme="light"] .auth-shell {
      border-color: #e2e8f0;
      background: #ffffff;
      box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    }

    html[data-theme="light"] .hero {
      border-right-color: #e2e8f0;
      background: linear-gradient(180deg, #eff6ff, #ecf3ff);
    }

    html[data-theme="light"] .feature,
    html[data-theme="light"] .section-card,
    html[data-theme="light"] .auth-tabs {
      border-color: #e2e8f0;
      background: #ffffff;
      box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    }

    html[data-theme="light"] .feature-icon {
      border-color: #cbd5e1;
      background: #f8fafc;
      color: #1e3a8a;
    }

    html[data-theme="light"] .hero-note {
      border-color: rgba(217, 119, 6, 0.32);
      background: rgba(217, 119, 6, 0.1);
      color: #8b5b16;
    }

    html[data-theme="light"] .field label,
    html[data-theme="light"] .field span {
      color: #334155;
    }

    html[data-theme="light"] .field input,
    html[data-theme="light"] .field textarea {
      border-color: #cbd5e1;
      background: #ffffff;
      color: #0f172a;
    }

    html[data-theme="light"] .field input:focus,
    html[data-theme="light"] .field textarea:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

    html[data-theme="light"] .helper-link {
      color: #1d4ed8;
    }

    html[data-theme="light"] .token-preview {
      border-color: #d4e2f6;
      background: #f6faff;
      color: #1e3a8a;
    }

    html[data-theme="light"] .token-preview code {
      color: #1d4ed8;
    }

    @media (max-width: 920px) {
      .auth-shell {
        grid-template-columns: 1fr;
      }

      .hero {
        border-right: none;
        border-bottom: 1px solid rgba(74, 122, 220, 0.25);
      }
    }

    @media (max-width: 620px) {
      .password-grid {
        grid-template-columns: 1fr;
      }

      .inline-actions {
        flex-direction: column;
        align-items: stretch;
      }

      .helper-link {
        white-space: normal;
      }
    }
