:root {
      --bg: #0a0b0e;
      --card-bg: rgba(17, 19, 25, 0.85);
      --primary: #818cf8;
      --primary-hover: #6366f1;
      --text: #f3f4f6;
      --text-muted: #9ca3af;
      --border: rgba(255, 255, 255, 0.08);
      --danger: #ef4444;
      --glass-blur: blur(16px);
      --font: 'Inter', system-ui, -apple-system, sans-serif;
    }

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

    body {
      background-color: var(--bg);
      color: var(--text);
      font-family: var(--font);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background-image: 
        radial-gradient(circle at 15% 20%, rgba(129, 140, 248, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.04) 0%, transparent 45%);
      padding: 1.5rem;
    }

    .auth-card {
      width: 100%;
      max-width: 420px;
      background: var(--card-bg);
      backdrop-filter: var(--glass-blur);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 2.5rem 2.2rem;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
      animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .auth-card h2 {
      font-size: 1.4rem;
      font-weight: 700;
      color: #fff;
      margin-bottom: 0.35rem;
      text-align: center;
      letter-spacing: -0.3px;
    }

    .auth-card p {
      font-size: 0.85rem;
      color: var(--text-muted);
      text-align: center;
      margin-bottom: 2rem;
    }

    .form-group {
      margin-bottom: 1.25rem;
      position: relative;
    }

    label {
      display: block;
      font-size: 0.8rem;
      font-weight: 500;
      margin-bottom: 0.4rem;
      color: #e5e7eb;
    }

    input {
      width: 100%;
      padding: 0.75rem 1rem;
      background: rgba(0, 0, 0, 0.35);
      border: 1px solid var(--border);
      border-radius: 8px;
      color: #fff;
      font-family: inherit;
      font-size: 0.9rem;
      outline: none;
      transition: all 0.2s ease;
    }

    input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
      background: rgba(0, 0, 0, 0.5);
    }

    input.invalid-input {
      border-color: var(--danger) !important;
      box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
    }

    .error-msg {
      font-size: 0.75rem;
      color: var(--danger);
      margin-top: 5px;
      display: flex;
      align-items: center;
      font-weight: 500;
    }

    .btn {
      width: 100%;
      background: var(--primary);
      color: #fff;
      border: none;
      padding: 0.8rem 1.25rem;
      border-radius: 8px;
      font-weight: 600;
      font-size: 0.9rem;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 4px 12px rgba(129, 140, 248, 0.25);
      margin-top: 0.5rem;
    }

    .btn:hover {
      background: var(--primary-hover);
      transform: translateY(-1px);
      box-shadow: 0 6px 16px rgba(129, 140, 248, 0.35);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    .auth-toggle {
      text-align: center;
      margin-top: 1.5rem;
      font-size: 0.82rem;
      color: var(--text-muted);
    }

    .auth-toggle span span {
      color: var(--primary);
      cursor: pointer;
      font-weight: 600;
      transition: color 0.2s;
    }

    .auth-toggle span span:hover {
      text-decoration: underline;
    }

    /* Access Code Field & Discord Help */
    .label-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.4rem;
    }

    .label-header label {
      margin-bottom: 0;
    }

    .btn-help-code {
      background: rgba(88, 101, 242, 0.15);
      border: 1px solid rgba(88, 101, 242, 0.35);
      color: #93a0ff;
      border-radius: 6px;
      padding: 3px 8px;
      font-size: 0.72rem;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.2s ease;
    }

    .btn-help-code:hover {
      background: rgba(88, 101, 242, 0.28);
      border-color: #5865F2;
      color: #fff;
    }

    /* Modal Popup Discord */
    .discord-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 1.5rem;
      animation: modalFadeIn 0.25s ease-out;
    }

    @keyframes modalFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .discord-modal-card {
      background: #12141c;
      border: 1px solid rgba(88, 101, 242, 0.3);
      border-radius: 18px;
      padding: 2.2rem 2rem;
      max-width: 440px;
      width: 100%;
      box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(88, 101, 242, 0.15);
      position: relative;
      text-align: center;
      animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes modalSlideUp {
      from { transform: translateY(15px) scale(0.96); opacity: 0; }
      to { transform: translateY(0) scale(1); opacity: 1; }
    }

    .modal-close-btn {
      position: absolute;
      top: 1rem;
      right: 1.1rem;
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-size: 1.5rem;
      line-height: 1;
      cursor: pointer;
      padding: 4px;
      border-radius: 6px;
      transition: color 0.2s, background 0.2s;
    }

    .modal-close-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.08);
    }

    .discord-badge-icon {
      width: 58px;
      height: 58px;
      background: rgba(88, 101, 242, 0.15);
      border: 1px solid rgba(88, 101, 242, 0.35);
      border-radius: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 1.2rem;
      color: #5865F2;
    }

    .discord-modal-title {
      font-size: 1.25rem;
      font-weight: 700;
      color: #fff;
      margin-bottom: 0.5rem;
      letter-spacing: -0.2px;
    }

    .discord-modal-desc {
      font-size: 0.88rem;
      color: var(--text-muted);
      line-height: 1.45;
      margin-bottom: 1.5rem;
    }

    .discord-modal-desc strong {
      color: #e5e7eb;
    }

    .discord-steps {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      text-align: left;
      background: rgba(0, 0, 0, 0.35);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1rem;
      margin-bottom: 1.6rem;
    }

    .discord-step {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 0.82rem;
      color: #d1d5db;
    }

    .step-badge {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: #5865F2;
      color: #fff;
      font-weight: 700;
      font-size: 0.75rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .discord-step code {
      background: rgba(88, 101, 242, 0.2);
      border: 1px solid rgba(88, 101, 242, 0.35);
      color: #93a0ff;
      padding: 2px 6px;
      border-radius: 4px;
      font-family: monospace;
      font-size: 0.85rem;
    }

    .discord-modal-actions {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
    }

    .btn-discord-primary {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: #5865F2;
      color: #fff;
      text-decoration: none;
      padding: 0.8rem 1.2rem;
      border-radius: 8px;
      font-weight: 600;
      font-size: 0.9rem;
      transition: all 0.2s ease;
      box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
    }

    .btn-discord-primary:hover {
      background: #4752c4;
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(88, 101, 242, 0.45);
    }

    .btn-discord-secondary {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text-muted);
      padding: 0.7rem 1.2rem;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .btn-discord-secondary:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.15);
    }