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

    :root {
      --bg: 0 0% 100%;
      --bg-alt: 220 20% 97%;
      --surface: 0 0% 100%;
      --border: 220 18% 90%;
      --border-strong: 220 16% 84%;
      --fg: 230 40% 8%;
      --fg-muted: 222 12% 44%;
      --fg-soft: 230 8% 58%;
      --brand: 250 95% 68%;
      --brand-strong: 250 95% 56%;
      --brand-soft: 250 95% 93%;
      --coral: 12 95% 67%;
      --green: 150 62% 44%;
      --stat-green: 142 60% 40%;
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --radius-xl: 24px;
      --radius-pill: 9999px;
      --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.06);
      --shadow-brand: 0 10px 28px rgba(110,100,255,0.25);
      --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      background: radial-gradient(circle at 20% 30%, hsl(250 95% 68% / 0.06) 0%, transparent 40%),
                  radial-gradient(circle at 80% 70%, hsl(12 95% 67% / 0.05) 0%, transparent 40%),
                  hsl(var(--bg));
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      color: hsl(var(--fg));
      -webkit-font-smoothing: antialiased;
    }

    .auth-container {
      width: 100%;
      max-width: 460px;
      position: relative;
    }

    .auth-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin-bottom: 32px;
      text-decoration: none;
      color: hsl(var(--fg));
    }
    .auth-logo__mark {
      width: 36px;
      height: 36px;
      background: linear-gradient(135deg, hsl(250 95% 68%), hsl(250 95% 56%));
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    }
    .auth-logo__mark svg {
      width: 20px;
      height: 20px;
    }
    .auth-logo span {
      font-weight: 800;
      font-size: 21px;
      letter-spacing: -0.02em;
    }

    .auth-card {
      background: hsl(var(--surface));
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius-xl);
      padding: 32px 28px;
      box-shadow: var(--shadow-card);
      backdrop-filter: blur(8px);
      transition: box-shadow var(--transition);
    }

    .auth-tabs {
      display: flex;
      background: hsl(var(--bg-alt));
      border-radius: var(--radius-pill);
      padding: 4px;
      margin-bottom: 28px;
      border: 1px solid hsl(var(--border));
      position: relative;
    }
    .auth-tab {
      flex: 1;
      text-align: center;
      padding: 10px 14px;
      font-weight: 700;
      font-size: 14px;
      color: hsl(var(--fg-muted));
      border-radius: var(--radius-pill);
      cursor: pointer;
      transition: color 0.2s;
      position: relative;
      z-index: 2;
      background: transparent;
      border: none;
    }
    .auth-tab.active {
      color: #fff;
    }
    .auth-tab-slider {
      position: absolute;
      top: 4px;
      bottom: 4px;
      left: 4px;
      width: calc(50% - 4px);
      background: linear-gradient(135deg, hsl(250 95% 68%), hsl(250 95% 56%));
      border-radius: var(--radius-pill);
      box-shadow: 0 4px 14px rgba(110,100,255,0.4);
      transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 1;
    }
    .auth-tabs.register-mode .auth-tab-slider {
      left: 50%;
    }

    .alert {
      padding: 12px 16px;
      border-radius: var(--radius-md);
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 20px;
      line-height: 1.45;
    }
    .alert-error {
      background: hsl(var(--coral) / 0.1);
      color: hsl(12 80% 45%);
      border: 1px solid hsl(var(--coral) / 0.28);
    }
    .alert-success {
      background: hsl(var(--green) / 0.1);
      color: hsl(var(--stat-green));
      border: 1px solid hsl(var(--green) / 0.28);
    }

    .role-switch {
      display: flex;
      background: hsl(var(--bg-alt));
      border-radius: var(--radius-pill);
      padding: 4px;
      border: 1px solid hsl(var(--border));
      gap: 4px;
    }
    .role-option {
      flex: 1;
      cursor: pointer;
    }
    .role-option input {
      display: none;
    }
    .role-option span {
      display: block;
      text-align: center;
      padding: 10px 14px;
      font-weight: 700;
      font-size: 14px;
      color: hsl(var(--fg-muted));
      border-radius: var(--radius-pill);
      transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    }
    .role-option input:checked + span {
      color: #fff;
      background: linear-gradient(135deg, hsl(250 95% 68%), hsl(250 95% 56%));
      box-shadow: 0 4px 14px rgba(110,100,255,0.35);
    }
    .role-option:hover span {
      color: hsl(var(--fg));
    }
    .role-option input:checked + span:hover {
      color: #fff;
    }

    .auth-form {
      display: flex;
      flex-direction: column;
      gap: 20px;
    }
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
      position: relative;
    }
    .form-label {
      font-size: 13px;
      font-weight: 700;
      color: hsl(var(--fg-muted));
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }
    .form-input {
      width: 100%;
      padding: 12px 44px 12px 16px;
      font-size: 15px;
      border: 1.5px solid hsl(var(--border));
      border-radius: var(--radius-md);
      background: hsl(var(--bg-alt));
      color: hsl(var(--fg));
      font-weight: 500;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
      font-family: inherit;
    }
    .form-input:focus {
      border-color: hsl(var(--brand-strong));
      box-shadow: 0 0 0 3px hsl(var(--brand) / 0.15);
      background: #fff;
    }
    .form-input.error {
      border-color: hsl(var(--coral));
      box-shadow: 0 0 0 3px hsl(var(--coral) / 0.12);
    }
    .input-icon {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: hsl(var(--fg-soft));
      display: flex;
      align-items: center;
      background: none;
      border: none;
      cursor: pointer;
      padding: 4px;
      border-radius: 6px;
      transition: color 0.15s;
    }
    .input-icon:hover {
      color: hsl(var(--fg));
    }
    .input-icon svg {
      width: 18px;
      height: 18px;
    }
    .error-message {
      font-size: 12px;
      color: hsl(var(--coral));
      font-weight: 500;
      margin-top: 2px;
      min-height: 18px;
    }

    .password-strength {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 8px;
    }
    .strength-bar {
      height: 4px;
      flex: 1;
      background: hsl(var(--border));
      border-radius: 2px;
      overflow: hidden;
    }
    .strength-bar-fill {
      height: 100%;
      width: 0%;
      transition: width 0.3s, background 0.3s;
      border-radius: 2px;
    }
    .strength-text {
      font-size: 11px;
      font-weight: 700;
      color: hsl(var(--fg-soft));
      letter-spacing: 0.03em;
    }

    .form-options {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 13px;
      margin-top: -4px;
    }
    .checkbox-label {
      display: flex;
      align-items: center;
      gap: 8px;
      color: hsl(var(--fg-muted));
      cursor: pointer;
      font-weight: 500;
    }
    .checkbox-label input {
      display: none;
    }
    .custom-checkbox {
      width: 18px;
      height: 18px;
      border: 1.5px solid hsl(var(--border-strong));
      border-radius: 5px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.15s, border-color 0.15s;
    }
    .custom-checkbox svg {
      width: 12px;
      height: 12px;
      opacity: 0;
      transform: scale(0.5);
      transition: opacity 0.15s, transform 0.15s;
      color: #fff;
    }
    .checkbox-label input:checked + .custom-checkbox {
      background: hsl(var(--brand-strong));
      border-color: hsl(var(--brand-strong));
    }
    .checkbox-label input:checked + .custom-checkbox svg {
      opacity: 1;
      transform: scale(1);
    }

    .text-link {
      color: hsl(var(--brand-strong));
      font-weight: 700;
      text-decoration: none;
      font-size: 13px;
      transition: opacity 0.15s;
      cursor: pointer;
      background: none;
      border: none;
    }
    .text-link:hover {
      opacity: 0.8;
    }

    .btn {
      width: 100%;
      padding: 14px 20px;
      border-radius: var(--radius-md);
      font-weight: 700;
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
      cursor: pointer;
      border: none;
      background: linear-gradient(135deg, hsl(250 95% 68%), hsl(250 95% 56%));
      color: #fff;
      box-shadow: var(--shadow-brand);
      letter-spacing: -0.01em;
    }
    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 14px 36px rgba(110,100,255,0.4);
    }
    .btn:active {
      transform: translateY(0);
    }
    .btn:disabled {
      opacity: 0.6;
      pointer-events: none;
    }

    .divider {
      display: flex;
      align-items: center;
      gap: 14px;
      color: hsl(var(--fg-soft));
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .divider::before,
    .divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: hsl(var(--border));
    }

    .social-buttons {
      display: flex;
      gap: 12px;
      justify-content: center;
    }
    .social-btn {
      width: 48px;
      height: 48px;
      border: 1.5px solid hsl(var(--border));
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      background: #fff;
      transition: border-color 0.2s, background 0.2s;
      cursor: pointer;
    }
    .social-btn:hover {
      border-color: hsl(var(--brand) / 0.5);
      background: hsl(var(--bg-alt));
    }
    .social-btn svg {
      width: 20px;
      height: 20px;
    }

    .auth-switch-text {
      text-align: center;
      font-size: 14px;
      color: hsl(var(--fg-muted));
      margin-top: 8px;
    }

    /* Modal overlay */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.4);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s, visibility 0.25s;
    }
    .modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }
    .modal-content {
      background: #fff;
      border-radius: var(--radius-xl);
      padding: 32px 28px;
      max-width: 400px;
      width: 90%;
      box-shadow: var(--shadow-card);
      transform: translateY(20px);
      transition: transform 0.25s;
      position: relative;
    }
    .modal-overlay.active .modal-content {
      transform: translateY(0);
    }
    .modal-close {
      position: absolute;
      top: 16px;
      right: 16px;
      background: none;
      border: none;
      color: hsl(var(--fg-soft));
      cursor: pointer;
      padding: 4px;
      border-radius: 8px;
    }
    .modal-close:hover {
      background: hsl(var(--bg-alt));
    }
    .modal-title {
      font-size: 20px;
      font-weight: 800;
      margin-bottom: 16px;
    }
    .success-message {
      background: hsl(var(--green) / 0.1);
      color: hsl(var(--stat-green));
      padding: 12px;
      border-radius: var(--radius-md);
      font-size: 14px;
      font-weight: 600;
      margin-top: 16px;
      display: none;
    }

    @media (max-width: 500px) {
      .auth-card {
        padding: 24px 18px;
      }
      .auth-tab {
        font-size: 13px;
        padding: 8px 10px;
      }
    }
