/* Layout specifico: login. Token e componenti comuni in theme/app-shell. */
@layer pages {

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    html { font-size: 16px; }

    body {
      font-family: 'Outfit', sans-serif;
      background-color: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      position: relative;
    }

    /* ── ANIMATED BACKGROUND ── */
    .bg-particles {
      position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    }
    .bg-particles .orb {
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      animation: orbFloat 20s ease-in-out infinite;
    }
    .bg-particles .orb:nth-child(1) {
      width: 500px; height: 500px;
      background: radial-gradient(circle, rgba(190,107,255,.12) 0%, transparent 70%);
      top: -15%; left: -10%;
      animation-duration: 25s;
    }
    .bg-particles .orb:nth-child(2) {
      width: 400px; height: 400px;
      background: radial-gradient(circle, rgba(190,107,255,.1) 0%, transparent 70%);
      top: 60%; right: -8%;
      animation-duration: 30s; animation-delay: -8s;
    }
    .bg-particles .orb:nth-child(3) {
      width: 300px; height: 300px;
      background: radial-gradient(circle, rgba(0,245,152,.06) 0%, transparent 70%);
      bottom: -5%; left: 30%;
      animation-duration: 22s; animation-delay: -4s;
    }
    @keyframes orbFloat {
      0%, 100% { transform: translate(0, 0) scale(1); }
      25% { transform: translate(30px, -40px) scale(1.1); }
      50% { transform: translate(-20px, 20px) scale(.95); }
      75% { transform: translate(15px, -15px) scale(1.05); }
    }

    /* ── GRID OVERLAY ── */
    body::after {
      content: '';
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background-image:
        linear-gradient(rgba(190,107,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(190,107,255,.018) 1px, transparent 1px);
      background-size: 60px 60px;
      mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
      -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
    }

    /* ── FLOATING PARTICLES ── */
    .particles-canvas {
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
    }

    .login-wrap {
      position: relative; z-index: 1;
      width: 100%; max-width: 460px;
      padding: 20px;
      animation: fadeUp .8s cubic-bezier(.16,1,.3,1);
    }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── HEADER ── */
    .login-brand {
      text-align: center;
      margin-bottom: 36px;
      animation: fadeUp .8s cubic-bezier(.16,1,.3,1) .1s both;
    }
    .login-brand .logo-wrap {
      display: inline-flex; align-items: center; gap: 14px;
      margin-bottom: 10px;
    }
    .login-brand .logo-icon {
      width: 48px; height: 48px; border-radius: var(--radius);
      background: linear-gradient(135deg, rgba(190,107,255,.15), rgba(220,220,220,.08));
      border: 1px solid rgba(190,107,255,.25);
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 8px 32px rgba(190,107,255,.15);
    }
    .login-brand .logo-flag {
      background: linear-gradient(90deg, #009246 0%, #009246 33%, #f0f0f0 33%, #f0f0f0 66%, #ce2b37 66%);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      background-clip: text;
      font-size: 18px; font-weight: 900; letter-spacing: 3px; line-height: 1;
    }
    .login-brand .logo-text {
      text-align: left;
    }
    .login-brand .logo-title {
      font-size: 22px; font-weight: 900; letter-spacing: -.5px;
      background: linear-gradient(135deg, #e2e4ea 0%, #8892a4 100%);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .login-brand .brand-sub {
      display: block;
      margin-top: 3px;
      font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2.5px;
      color: var(--accent);
    }
    .login-brand .version-pill {
      display: inline-block;
      margin-top: 12px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px; font-weight: 600; letter-spacing: 1px;
      color: var(--muted);
      background: rgba(255,255,255,.03);
      border: 1px solid rgba(255,255,255,.07);
      border-radius: 20px; padding: 3px 12px;
    }

    /* ── CARD ── */
    .login-card {
      background: var(--card);
      backdrop-filter: blur(40px) saturate(1.3);
      -webkit-backdrop-filter: blur(40px) saturate(1.3);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 40px 36px;
      position: relative;
      overflow: hidden;
      box-shadow:
        0 40px 100px rgba(0,0,0,.6),
        0 0 0 1px rgba(255,255,255,.03) inset;
      animation: fadeUp .8s cubic-bezier(.16,1,.3,1) .2s both;
    }
    .login-card::after {
      content: '';
      position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
      background: conic-gradient(from 180deg, transparent 0%, rgba(190,107,255,.03) 20%, transparent 40%);
      animation: shimmerRotate 8s linear infinite;
      pointer-events: none;
    }
    @keyframes shimmerRotate {
      from { transform: rotate(0deg); }
      to   { transform: rotate(360deg); }
    }

    .login-title {
      font-size: 22px; font-weight: 900; letter-spacing: -.5px;
      color: var(--text); margin-bottom: 6px;
      position: relative; z-index: 1;
      display: flex; align-items: center; gap: 10px;
    }
    .login-title .title-icon {
      width: 36px; height: 36px; border-radius: 10px;
      background: rgba(190,107,255,.1);
      border: 1px solid rgba(190,107,255,.2);
      display: flex; align-items: center; justify-content: center;
      color: var(--accent); font-size: 15px;
    }
    .login-subtitle {
      font-size: 13px; color: var(--muted);
      margin-bottom: 30px;
      padding-left: 46px;
      position: relative; z-index: 1;
    }

    /* ── STATUS LINE ── */
    .login-status {
      position: relative; z-index: 1;
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 24px;
      padding: 10px 14px;
      background: rgba(0,245,152,.02);
      border: 1px solid rgba(0,245,152,.12);
      border-radius: 10px;
    }
    .status-dot {
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--ok);
      box-shadow: 0 0 8px rgba(0,245,152,.5);
      animation: pulse 2s ease-in-out infinite;
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(0,245,152,.5); }
      50% { opacity: .6; box-shadow: 0 0 16px rgba(0,245,152,.8); }
    }
    .status-text { font-size: 12px; font-weight: 600; color: var(--ok); }
    .status-ping {
      margin-left: auto;
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px; color: var(--muted);
    }

    /* ── INFO BOX ── */
    .login-info {
      background: rgba(190,107,255,.04);
      border: 1px solid rgba(190,107,255,.12);
      border-radius: 12px;
      padding: 16px 18px;
      margin-bottom: 28px;
      position: relative; z-index: 1;
    }
    .login-info-title {
      font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px;
      color: var(--accent-2); margin-bottom: 12px;
      display: flex; align-items: center; gap: 7px;
    }
    .login-info ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
    .login-info li {
      display: flex; align-items: center; gap: 10px;
      font-size: 13px; color: var(--text-2);
      transition: color .2s;
    }
    .login-info li:hover { color: var(--text); }
    .login-info li .check-icon {
      width: 20px; height: 20px; border-radius: 6px;
      background: rgba(0,245,152,.1);
      border: 1px solid rgba(0,245,152,.2);
      display: flex; align-items: center; justify-content: center;
      color: var(--ok); font-size: 9px; flex-shrink: 0;
    }

    /* ── DISCORD BUTTON ── */
    .btn-discord {
      display: flex; align-items: center; gap: 14px;
      width: 100%;
      background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
      border: 1px solid rgba(190,107,255,.4);
      border-radius: var(--radius);
      padding: 16px 22px;
      color: #fff; font-family: 'Outfit', sans-serif;
      font-size: 15px; font-weight: 800;
      text-decoration: none;
      cursor: pointer;
      transition: all .3s cubic-bezier(.16,1,.3,1);
      position: relative; z-index: 1;
      box-shadow: 0 8px 32px rgba(190,107,255,.3);
      overflow: hidden;
    }
    .btn-discord::before {
      content: '';
      position: absolute; inset: 0;
      background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,.1) 50%, transparent 100%);
      transform: translateX(-100%);
      transition: transform .5s;
    }
    .btn-discord:hover::before { transform: translateX(100%); }
    .btn-discord:hover {
      transform: translateY(-3px) scale(1.01);
      box-shadow: 0 16px 48px rgba(190,107,255,.45);
      border-color: rgba(190,107,255,.7);
    }
    .btn-discord:active { transform: translateY(-1px) scale(.99); }
    .btn-discord .disc-icon-wrap {
      width: 40px; height: 40px; border-radius: 11px;
      background: rgba(255,255,255,.15);
      display: flex; align-items: center; justify-content: center;
      font-size: 20px; flex-shrink: 0;
    }
    .btn-discord-lbl { display: flex; flex-direction: column; align-items: flex-start; }
    .btn-discord-lbl span { font-size: 11px; font-weight: 600; opacity: .7; letter-spacing: .3px; margin-top: 2px; }
    .btn-discord .arrow-icon {
      margin-left: auto; font-size: 14px; opacity: .5;
      transition: transform .2s, opacity .2s;
    }
    .btn-discord:hover .arrow-icon { transform: translateX(4px); opacity: 1; }

    /* ── FOOTER ── */
    .login-footer {
      text-align: center;
      margin-top: 24px;
      font-size: 11px; color: var(--muted);
      position: relative; z-index: 1;
      display: flex; flex-direction: column; gap: 6px;
    }
    .login-footer strong { color: var(--accent-2); }

    /* ── ERROR ALERT ── */
    .login-error {
      background: rgba(255,51,85,.07);
      border: 1px solid rgba(255,51,85,.22);
      border-radius: 10px; padding: 12px 16px;
      color: var(--danger); font-size: 13px;
      display: flex; align-items: center; gap: 10px;
      margin-bottom: 20px;
      position: relative; z-index: 1;
      animation: shake .4s ease-in-out;
    }
    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      20% { transform: translateX(-6px); }
      40% { transform: translateX(6px); }
      60% { transform: translateX(-4px); }
      80% { transform: translateX(4px); }
    }

    /* ── CORNERS ── */
    .corner {
      position: absolute; width: 22px; height: 22px;
      border-color: rgba(190,107,255,.2); border-style: solid; pointer-events: none; z-index: 2;
      transition: border-color .3s;
    }
    .login-card:hover .corner { border-color: rgba(190,107,255,.4); }
    .corner.tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; border-radius: 5px 0 0 0; }
    .corner.tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; border-radius: 0 5px 0 0; }
    .corner.bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; border-radius: 0 0 0 5px; }
    .corner.br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; border-radius: 0 0 5px 0; }

    @media (max-width: 500px) {
      .login-card { padding: 28px 22px; border-radius: var(--radius-lg); }
      .login-brand .logo-wrap { gap: 10px; }
      .login-brand .logo-title { font-size: 18px; }
    }

}
