@layer pages {
  .auth-page {
      min-height: 80vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: var(--ds-space-8) var(--ds-space-4);
  }

  .auth-card {
      width: 100%;
      max-width: 440px;
  }

  .auth-card .wf-panel {
      box-shadow: var(--ds-shadow-sm);
      border-radius: var(--ds-radius-lg);
      border: 1px solid var(--ds-border-color-light);
  }

  .auth-card .wf-panel-header {
      text-align: center;
      padding: var(--ds-space-8) var(--ds-space-8) var(--ds-space-4);
      border-bottom: none;
      background: transparent;
  }

  .auth-title {
      font-size: 1.5rem;
      font-weight: var(--ds-font-weight-semibold);
      color: var(--ds-color-text-primary);
      margin: 0;
  }

  .auth-subtitle {
      font-size: var(--ds-font-size-sm);
      color: var(--ds-color-text-tertiary);
      margin: var(--ds-space-2) 0 0;
  }

  .auth-body {
      padding: 0 var(--ds-space-8) var(--ds-space-8);
  }

  /* Value proposition banner */
  .auth-value-banner {
      display: flex;
      align-items: center;
      gap: var(--ds-space-3);
      padding: var(--ds-space-4);
      background: var(--ds-color-bg-secondary);
      border: 1px solid var(--ds-border-color-light);
      border-radius: var(--ds-radius-lg);
      margin-bottom: var(--ds-space-6);
  }

  .auth-value-banner-icon {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--ds-color-bg-primary);
      border: 1px solid var(--ds-border-color);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: var(--ds-font-size-md);
      color: var(--ds-color-text-primary);
  }

  .auth-value-banner-title {
      font-size: var(--ds-font-size-sm);
      font-weight: var(--ds-font-weight-medium);
      color: var(--ds-color-text-primary);
      margin: 0;
  }

  .auth-value-banner-subtitle {
      font-size: var(--ds-font-size-xs);
      color: var(--ds-color-text-tertiary);
      margin: 0;
  }

  .auth-form-group {
      margin-bottom: var(--ds-space-5);
  }

  .auth-label {
      display: block;
      font-size: 0.6875rem;
      font-weight: var(--ds-font-weight-semibold);
      color: var(--ds-color-text-tertiary);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: var(--ds-space-2);
  }

  .auth-label-optional {
      font-weight: var(--ds-font-weight-normal);
      text-transform: none;
      letter-spacing: normal;
      color: var(--ds-color-text-tertiary);
  }

  .auth-input,
  .auth-select {
      width: 100%;
      padding: 0.625rem var(--ds-space-4);
      background: var(--ds-color-bg-primary);
      border: 1px solid var(--ds-border-color);
      border-radius: var(--ds-radius-md);
      color: var(--ds-color-text-primary);
      font-size: var(--ds-font-size-sm);
      transition: all 0.15s ease;
  }

  .auth-input:focus,
  .auth-select:focus {
      outline: none;
      border-color: var(--ds-color-text-tertiary);
      box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-color-text-tertiary) 10%, transparent);
  }

  .auth-input::placeholder {
      color: var(--ds-color-text-tertiary);
  }

  .auth-hint {
      font-size: var(--ds-font-size-xs);
      color: var(--ds-color-text-tertiary);
      margin-top: var(--ds-space-1);
      margin-bottom: var(--ds-space-4);
  }

  .auth-hint-password {
      margin-top: calc(-1 * var(--ds-space-2));
  }

  /* Side-by-side password fields */
  .auth-password-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: var(--ds-space-4);
  }

  .auth-password-row .auth-form-group {
      margin-bottom: 0;
  }

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

  /* Select wrapper for custom chevron */
  .auth-select-wrapper {
      position: relative;
  }

  .auth-select-wrapper .auth-select {
      appearance: none;
      padding-right: var(--ds-space-8);
      cursor: pointer;
  }

  .auth-select-icon {
      position: absolute;
      right: var(--ds-space-3);
      top: 50%;
      transform: translateY(-50%);
      font-size: 0.625rem;
      color: var(--ds-color-text-tertiary);
      pointer-events: none;
  }

  .auth-check {
      display: flex;
      align-items: center;
      gap: var(--ds-space-2);
      margin-bottom: var(--ds-space-5);
  }

  .auth-check input[type="checkbox"] {
      width: 16px;
      height: 16px;
      accent-color: var(--ds-color-accent);
      cursor: pointer;
  }

  .auth-check label {
      font-size: var(--ds-font-size-sm);
      color: var(--ds-color-text-secondary);
      cursor: pointer;
  }

  .auth-divider {
      display: flex;
      align-items: center;
      gap: var(--ds-space-3);
      margin: var(--ds-space-6) 0;
      color: var(--ds-color-text-tertiary);
      font-size: var(--ds-font-size-xs);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      font-weight: var(--ds-font-weight-medium);
  }

  .auth-divider::before,
  .auth-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--ds-border-color-light);
  }

  .auth-google {
      width: 100%;
      padding: 0.625rem;
      background: var(--ds-color-bg-primary);
      border: 1px solid var(--ds-border-color);
      border-radius: var(--ds-radius-md);
      color: var(--ds-color-text-secondary);
      font-size: var(--ds-font-size-sm);
      font-weight: var(--ds-font-weight-medium);
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: var(--ds-space-3);
      text-decoration: none;
  }

  .auth-google:hover {
      background: var(--ds-color-bg-secondary);
      border-color: var(--ds-color-text-tertiary);
      color: var(--ds-color-text-primary);
  }

  .auth-google-svg {
      flex-shrink: 0;
  }

  .auth-footer {
      text-align: center;
      margin-top: var(--ds-space-5);
      font-size: var(--ds-font-size-xs);
      color: var(--ds-color-text-tertiary);
  }

  .auth-footer a {
      color: var(--ds-color-text-secondary);
      text-decoration: none;
      font-weight: var(--ds-font-weight-medium);
  }

  .auth-footer a:hover {
      color: var(--ds-color-text-primary);
      text-decoration: none;
  }


  .auth-alert {
      padding: var(--ds-space-3) var(--ds-space-4);
      border-radius: var(--ds-radius-md);
      font-size: var(--ds-font-size-sm);
      margin-bottom: var(--ds-space-4);
      display: flex;
      align-items: center;
      gap: var(--ds-space-2);
  }

  .auth-alert-success {
      background: var(--ds-color-success-bg);
      color: var(--ds-color-success);
      border: 1px solid var(--ds-color-success-light);
  }

  .auth-alert-danger {
      background: var(--ds-color-error-bg);
      color: var(--ds-color-error);
      border: 1px solid var(--ds-color-error-light);
  }

  /* 2FA Modal Styles */
  .twofa-modal-backdrop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1050;
  }

  .twofa-modal-backdrop.show {
      display: flex;
  }

  .twofa-modal {
      background: var(--ds-color-bg-primary);
      border-radius: var(--ds-radius-lg);
      box-shadow: var(--ds-shadow-lg);
      width: 100%;
      max-width: 400px;
      margin: var(--ds-space-4);
  }

  .twofa-modal-header {
      padding: var(--ds-space-5) var(--ds-space-6);
      border-bottom: 1px solid var(--ds-border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
  }

  .twofa-modal-title {
      font-size: var(--ds-font-size-lg);
      font-weight: var(--ds-font-weight-semibold);
      color: var(--ds-color-text-primary);
      margin: 0;
      display: flex;
      align-items: center;
      gap: var(--ds-space-2);
  }

  .twofa-modal-close {
      background: none;
      border: none;
      font-size: var(--ds-font-size-xl);
      color: var(--ds-color-text-tertiary);
      cursor: pointer;
      padding: var(--ds-space-1);
  }

  .twofa-modal-close:hover {
      color: var(--ds-color-text-primary);
  }

  .twofa-modal-body {
      padding: var(--ds-space-6);
  }

  .twofa-message {
      color: var(--ds-color-text-secondary);
      font-size: var(--ds-font-size-base);
      margin-bottom: var(--ds-space-5);
  }

  .twofa-code-input {
      width: 100%;
      padding: var(--ds-space-3) var(--ds-space-4);
      font-family: monospace;
      font-size: var(--ds-font-size-xl);
      letter-spacing: 0.5rem;
      text-align: center;
      background: var(--ds-color-bg-primary);
      border: 2px solid var(--ds-border-color);
      border-radius: var(--ds-radius-md);
      color: var(--ds-color-text-primary);
      transition: all 0.15s ease;
  }

  .twofa-code-input:focus {
      outline: none;
      border-color: var(--ds-color-accent);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-color-accent) 15%, transparent);
  }

  .twofa-code-input::placeholder {
      color: var(--ds-color-text-tertiary);
      letter-spacing: 0.25rem;
  }

  .twofa-modal-footer {
      padding: var(--ds-space-4) var(--ds-space-6) var(--ds-space-6);
      display: flex;
      flex-direction: column;
      gap: var(--ds-space-3);
  }

  .twofa-trust-device {
      display: flex;
      align-items: center;
      gap: var(--ds-space-2);
      margin-bottom: var(--ds-space-2);
  }

  .twofa-trust-device input[type="checkbox"] {
      width: 16px;
      height: 16px;
      accent-color: var(--ds-color-accent);
      cursor: pointer;
  }

  .twofa-trust-device label {
      font-size: var(--ds-font-size-sm);
      color: var(--ds-color-text-secondary);
      cursor: pointer;
  }

  .twofa-backup-link {
      font-size: var(--ds-font-size-sm);
      color: var(--ds-color-text-tertiary);
      text-align: center;
  }

  .twofa-backup-link a {
      color: var(--ds-color-accent);
      text-decoration: none;
  }

  .twofa-backup-link a:hover {
      text-decoration: underline;
  }
}
