:root {
      --text: #1f2937;
      --muted: #6b7280;
      --primary: #7c8cff;
      --border: rgba(255,255,255,0.45);
      --card-bg: rgba(249, 250, 251, 0.5);
      --glow: rgba(124, 140, 255, 0.3);
      --bg-gradient: radial-gradient(circle at top, #f4f9ffd3, #fbfbfb);
      --btn-bg: white;
      --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.35));
    }

    [data-theme="dark"] {
      --bg-gradient: radial-gradient(circle at top, #111827, #030712);
      --text: #f3f4f6;
      --muted: #9ca3af;
      --primary: #a5b4fc;
      --border: rgba(255,255,255,0.1);
      --card-bg: rgba(31, 41, 55, 0.7);
      --btn-bg: #1f2937;
      --glass-bg: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.6));
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      font-family: 'Inter', sans-serif;
      background: var(--bg-gradient);
      background-attachment: fixed;
      color: var(--text);
      line-height: 1.5;
      overflow-x: hidden;
      min-height: 100vh;
      transition: background 0.3s ease, color 0.3s ease;
    }

    #theme-toggle {
      position: fixed; bottom: 25px; right: 25px; z-index: 1000;
      width: 50px; height: 50px; background: var(--primary);
      color: white; border: none; border-radius: 50%; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 10px 20px rgba(0,0,0,0.2);
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
      transition: all 0.3s ease;
    }

    .security-modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.6);
      display: flex; align-items: center; justify-content: center; z-index: 10001;
    }
    .security-card {
      width: 90%; max-width: 350px; padding: 25px; text-align: center;
    }
    .security-card h2 { margin-bottom: 5px; font-size: 1.2rem; }
    .input-group { position: relative; margin-bottom: 15px; }
    .input-group input {
      width: 100%; padding: 12px; padding-right: 45px; 
      border-radius: 10px; border: 1px solid var(--border);
      background: var(--btn-bg); color: var(--text);
    }
    .eye-btn {
      position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
      background: none; border: none; cursor: pointer; color: var(--muted);
      display: flex; align-items: center; justify-content: center;
    }
    .hidden { display: none !important; }
    .holding-btn {
      animation: hold-pulse 8s linear forwards;
    }

    @keyframes hold-pulse {
      0% { transform: scale(1); background: var(--primary); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
      50% { transform: scale(1.3); background: #4f46e5; box-shadow: 0 0 30px #7c8cff; }
      100% { transform: scale(1.1); background: #10b981; box-shadow: 0 0 40px #10b981; }
    }

    .back {
      position: fixed; top: 25px; left: 25px; z-index: 1000;
      display: flex; align-items: center; justify-content: center;
      width: 50px; height: 50px; background: var(--btn-bg);
      border-radius: 50%; box-shadow: 0 10px 20px rgba(0,0,0,0.1);
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      border: 1px solid var(--border);
    }

    .back img { width: 30px; height: 30px; object-fit: contain; pointer-events: none; }
    [data-theme="dark"] .back img { filter: brightness(0) invert(1); }
    .back:hover { transform: scale(1.1); }
    .back:active { transform: scale(0.9); }

    .glass {
      background: var(--glass-bg);
      backdrop-filter: blur(22px) saturate(140%);
      -webkit-backdrop-filter: blur(22px) saturate(140%);
      border: 1px solid var(--border);
      box-shadow: 0 20px 40px rgba(0,0,0,0.08);
      border-radius: 30px;
    }

    .top { padding: 50px 0 20px; display: flex; justify-content: center; }

    .icon-top {
      height: 180px; width: 180px; border-radius: 50%;
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      object-fit: cover; border: 6px solid var(--btn-bg);
      box-shadow: 0 15px 30px rgba(0,0,0,0.1), 0 0 0 10px rgba(124, 140, 255, 0.05);
      pointer-events: none;
    }

    .section-title {
      text-align: center; margin: 20px 0 40px;
      font-size: clamp(32px, 5vw, 48px); font-weight: 800;
      background: linear-gradient(to right, #4f46e5, #7c8cff);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }

    .features {
      max-width: 1100px; margin: 0 auto 80px;
      display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 30px; padding: 0 20px; align-items: start;
    }

    .card { padding: 24px; display: flex; flex-direction: column; transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
    .card h3 { margin-bottom: 10px; font-size: 22px; color: var(--text); }
    .card-footer { display: flex; justify-content: center; gap: 10px; margin-top: auto; width: 100%; }

    .card a { 
      font-weight: 600; color: var(--primary); text-decoration: none;
      padding: 12px 24px; background: var(--btn-bg);
      border: 1px solid var(--border); border-radius: 14px;
      width: fit-content; transition: all 0.3s ease;
    }

    .card a:hover {
      background: var(--primary); color: white;
      transform: translateY(-2px); box-shadow: 0 10px 20px rgba(124, 140, 255, 0.2);
    }

    .admin-overlay{
      position:fixed; inset:0; background:rgba(0,0,0,.4);
      display:flex; align-items:center; justify-content:center; z-index:9999;
    }
    .admin-overlay.hidden{display:none}
    .admin-modal{ width:90%; max-width:420px; padding:30px; animation:pop .4s ease; }
    .admin-check{ display:flex; gap:10px; font-weight:600; margin-bottom:20px; }
    #class-inputs{ display:grid; gap:12px; margin-bottom:20px; }
    .admin-modal input{ padding:12px; border-radius:12px; border:1px solid var(--border); background: var(--btn-bg); color: var(--text); }
    .admin-actions{ display:flex; gap:10px; }
    .admin-actions button{ flex:1; padding:12px; border-radius:12px; border:none; font-weight:600; cursor:pointer; }
    .admin-actions .save{ background:linear-gradient(135deg,var(--primary),#4f46e5); color:white; }
    .admin-actions .cancel{ background:#e5e7eb; color: #1f2937; }
    @keyframes pop{ from{transform:scale(.9);opacity:0} to{transform:scale(1);opacity:1} }
    .card button{
      font-weight: 700; color: white; text-decoration: none;
      padding: 12px 24px; background: linear-gradient(135deg, var(--primary), #4f46e5);
      border: 1px solid var(--border); border-radius: 14px;
      width: fit-content; transition: all 0.3s ease; cursor:pointer;
    }
    .card button:hover{ transform: translateY(-2px); box-shadow: 0 10px 20px rgba(124, 140, 255, 0.25); }

    .topnav{
      position: fixed; top: 18px; right: 90px; z-index: 1000;
      display:flex; gap:10px; align-items:center;
      padding: 10px 12px;
    }
    .topnav a{
      font-weight:600; color: var(--text); text-decoration:none;
      padding:10px 14px; border-radius:12px; border:1px solid var(--border);
      background: var(--btn-bg);
    }
    .topnav a:hover{ background: var(--primary); color:white; }
    .topnav button{
      font-weight:600; color: var(--text);
      padding:10px 14px; border-radius:12px; border:1px solid var(--border);
      background: var(--btn-bg); cursor:pointer;
    }
    .topnav button:hover{ background:#ef4444; color:white; border-color: transparent; }
    #subscribeBtn{
      min-width: 200px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      border-radius: 999px;
      padding: 14px 26px;
      line-height: 1;
      letter-spacing: 0.2px;
      box-shadow: 0 14px 28px rgba(0,0,0,0.18);
      user-select: none;
    }
    #subscribeBtn:active{ transform: translateY(0px) scale(0.98); }
    #subscribeBtn:disabled{
      opacity: 0.75;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
    #subscribeBtn.is-loading{
      pointer-events: none;
    }
    #subscribeBtn.is-loading::before{
      content: "";
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 2px solid rgba(255,255,255,0.45);
      border-top-color: rgba(255,255,255,0.95);
      animation: tu-spin 0.8s linear infinite;
    }
    @keyframes tu-spin{ to { transform: rotate(360deg); } }

    .text-center{ text-align:center; }


    #subscribeBtn.subscribe-btn{
      width: 100%;
      max-width: 360px;
      margin: 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 12px 16px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--glass-bg);
      color: var(--text);
      font-weight: 800;
      letter-spacing: 0.2px;
      cursor: pointer;
      transition: transform .15s ease, box-shadow .15s ease, background .2s ease, color .2s ease;
    }
    #subscribeBtn.subscribe-btn:hover{ transform: translateY(-1px); box-shadow: 0 14px 28px rgba(0,0,0,0.18); }
    #subscribeBtn.subscribe-btn:active{ transform: translateY(0px) scale(0.99); }
    #subscribeBtn.subscribe-btn:disabled{ opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }

    #subscribeBtn .btn-meta{
      font-weight: 700;
      font-size: 0.85rem;
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(0,0,0,0.06);
      color: var(--muted);
    }
    [data-theme="dark"] #subscribeBtn .btn-meta{ background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); }

    #subscribeBtn.is-subscribed{
      background: linear-gradient(135deg, rgba(59,130,246,0.95), rgba(99,102,241,0.95));
      color: #fff;
      border-color: rgba(255,255,255,0.22);
      box-shadow: 0 14px 34px rgba(59,130,246,0.22);
    }
    #subscribeBtn.is-subscribed .btn-meta{ background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.92); }

    #subscribeBtn.is-logged-out{
      background: linear-gradient(135deg, rgba(16,185,129,0.92), rgba(59,130,246,0.92));
      color: #fff;
      border-color: rgba(255,255,255,0.22);
    }
    #subscribeBtn.is-loading{ opacity: .75; }

    #subMsg{
      text-align: center;
      margin-top: 10px;
      color: var(--muted);
      font-weight: 600;
    }
