/* ==========================================================================
   Chametwala.com - Mobile-First Auth Styles
   ========================================================================== */

/* ==========================================================================
   LOADING SCREEN
   ========================================================================== */
.cw-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #F8F7FC;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cw-loading-screen.cw-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.cw-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: transparent;
  border: 0;
  box-shadow: none;
}
.cw-loading-screen.cw-hidden .cw-loading-inner {
  transform: scale(0.95);
}
.cw-loading-logo {
  width: min(240px, 65vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.cw-loading-gif {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
}
.cw-progress-track {
  width: 50%;
  max-width: 160px;
  height: 5px;
  background: rgba(109, 56, 244, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
.cw-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6D38F4 0%, #8A3EF0 50%, #F0358D 100%);
  border-radius: 99px;
  /* Driven entirely by requestAnimationFrame for absolute smoothness */
}

:root {
  /* Colors */
  --color-page-bg: #F8F7FC;
  --color-surface-primary: #FFFFFF;
  --color-text-primary: #17152A;
  --color-text-secondary: #737087;
  --color-text-label: #29263D;
  --color-text-muted: #8E98B0;
  --color-soft-brand: rgba(109, 56, 244, 0.055);

  /* AUTH_V2_FINAL Brand Gradient */
  --color-brand-gradient: linear-gradient(100deg, #6D38F4 0%, #8A3EF0 48%, #F0358D 100%);
  --color-brand-gradient-hover: linear-gradient(100deg, #5B2FE3 0%, #7B35E0 48%, #E0277C 100%);
  --color-brand-primary: #6D38F4;

  --color-focus: #6D38F4;
  --color-focus-ring: rgba(109, 56, 244, 0.25);
  
  --color-success: #12A150;
  --color-success-bg: rgba(18, 161, 80, 0.08);
  --color-error: #ED334E;
  --color-error-bg: rgba(237, 51, 78, 0.08);

  --color-inactive-surface: rgba(109, 56, 244, 0.05);
  --color-inactive-surface-hover: rgba(109, 56, 244, 0.08);
  --color-soft-border: rgba(73, 55, 112, 0.12);
  --color-input-bg: #FFFFFF;
  --color-input-border: rgba(73, 55, 112, 0.12);

  /* Mobile-first Spacing */
  --space-micro: 4px;
  --space-tight: 8px;
  --space-related: 12px;
  --space-section: 16px;
  --space-major: 20px;
  --space-card: 20px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --weight-body: 400;
  --weight-label: 600;
  --weight-input: 500;
  --weight-button: 700;
  --weight-heading: 700;

  /* Radius */
  --radius-card: 24px;
  --radius-selector: 14px;
  --radius-input: 16px;
  --radius-button: 14px;

  /* Depth */
  --shadow-card: 0 12px 32px rgba(73, 55, 112, 0.08), 0 2px 6px rgba(73, 55, 112, 0.03);
  --shadow-selector-active: 0 2px 8px rgba(109, 56, 244, 0.15), 0 1px 2px rgba(73, 55, 112, 0.04);
  --shadow-button: 0 4px 14px rgba(109, 56, 244, 0.3);
  --shadow-button-hover: 0 6px 20px rgba(109, 56, 244, 0.4);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global & Box Sizing --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-weight: var(--weight-body);
  color: var(--color-text-primary);
  background-color: var(--color-page-bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-section);
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-ambient-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(124, 58, 237, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(236, 72, 153, 0.03) 0%, transparent 45%);
}

/* --- Layout --- */
.auth-page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: auto;
}

/* --- Auth Card --- */
.auth-card {
  background: var(--color-surface-primary);
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-soft-border);
  box-shadow: var(--shadow-card);
  padding: var(--space-card) 16px;
  position: relative;
}

/* --- Top Right Tutorial Button --- */
.tutorial-hook {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-inactive-surface);
  color: var(--color-focus);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}
.tutorial-hook:hover {
  background: var(--color-focus);
  color: #FFF;
  transform: scale(1.05);
}
.tutorial-hook:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.tutorial-hook svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
  fill: currentColor;
}

/* --- Brand Header --- */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-major);
}

.brand-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--color-brand-gradient);
  color: #FFFFFF;
  box-shadow: var(--shadow-button);
  margin-bottom: var(--space-tight);
}

.brand-logo-badge svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: var(--weight-heading);
  color: var(--color-deep-navy);
  letter-spacing: -0.02em;
}

/* --- Auth Mode Selector (Animated Segmented Switch) --- */
.auth-mode-selector-wrapper {
  margin-bottom: var(--space-major);
}
.auth-mode-selector {
  display: flex;
  position: relative;
  background: var(--color-inactive-surface);
  padding: 4px;
  border-radius: var(--radius-selector);
  border: 1px solid var(--color-soft-border);
  gap: 0;
  width: 100%;
}

.auth-slider-bg {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--color-surface-primary);
  border-radius: calc(var(--radius-selector) - 4px);
  box-shadow: var(--shadow-selector-active);
  transition: transform var(--transition-normal);
  z-index: 1;
}

.auth-mode-selector.is-signup .auth-slider-bg {
  transform: translateX(100%);
}

.tab-button {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 8px;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: var(--weight-label);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  user-select: none;
  min-height: 42px;
  transition: color var(--transition-fast), font-weight var(--transition-fast);
}

.tab-button[aria-selected="true"] {
  color: var(--color-text-primary);
  font-weight: var(--weight-button);
}

.tab-button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
  border-radius: calc(var(--radius-selector) - 4px);
}

/* --- Forms Container --- */
.forms-container {
  position: relative;
  overflow: hidden;
  min-height: 250px;
}

.auth-form-panel {
  display: none;
  opacity: 0;
  transform: translateX(15px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  width: 100%;
}

.auth-form-panel.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* Sub-views for Multi-step forms */
.auth-sub-view {
  display: none;
  opacity: 0;
  animation: fadeIn var(--transition-normal) forwards;
}
.auth-sub-view.active {
  display: block;
}

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

.form-header {
  text-align: left;
  margin-bottom: var(--space-section);
}

.form-title {
  font-size: 30px;
  font-weight: var(--weight-heading);
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .form-title {
    font-size: 32px;
  }
}

.form-supporting {
  font-size: 0.875rem;
  font-weight: var(--weight-body);
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-top: var(--space-tight);
}

/* --- Typing / Soft Text Reveal --- */
@keyframes softTextReveal {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.active .form-title {
  animation: softTextReveal 600ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.active .form-supporting {
  opacity: 0;
  animation: softTextReveal 600ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms forwards;
}

/* --- Form Fields --- */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  width: 100%;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label {
  font-size: 0.875rem;
  font-weight: var(--weight-label);
  color: var(--color-text-primary);
}

.forgot-password-link {
  font-size: 0.8125rem;
  font-weight: var(--weight-button);
  color: var(--color-focus);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.forgot-password-link:hover {
  text-decoration: underline;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.form-input {
  width: 100%;
  min-height: 48px; /* >= 44px */
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: var(--weight-input);
  color: var(--color-text-primary);
  background-color: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-input);
  transition: all var(--transition-normal);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-focus);
  background-color: var(--color-inactive-surface);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.input-wrapper.has-country-code .form-input {
  padding-left: 92px;
}
.input-wrapper.has-password-toggle .form-input {
  padding-right: 48px;
}

/* Country Code Prefix */
.country-prefix {
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  border: none;
  border-right: 1px solid var(--color-input-border);
  border-radius: var(--radius-input) 0 0 var(--radius-input);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.flag-icon {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.country-prefix:hover {
  background: var(--color-inactive-surface);
}
.country-prefix:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

/* Password Toggle Icon */
.password-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
  transition: color var(--transition-fast);
}
.password-toggle:hover {
  color: var(--color-text-primary);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

/* Checkbox (Remember Device) */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 44px;
  padding: 4px 0;
}
.checkbox-input {
  display: none;
}
.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-input-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-primary);
  transition: all var(--transition-fast);
}
.custom-checkbox svg {
  width: 14px;
  height: 14px;
  color: #FFF;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--transition-fast);
}
.checkbox-input:checked + .custom-checkbox {
  background: var(--color-focus);
  border-color: var(--color-focus);
}
.checkbox-input:checked + .custom-checkbox svg {
  opacity: 1;
  transform: scale(1);
}
.checkbox-input:focus-visible + .custom-checkbox {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.checkbox-label {
  font-size: 0.875rem;
  font-weight: var(--weight-body);
  color: var(--color-text-primary);
}

/* Errors */
.form-group.has-error .form-input {
  border-color: var(--color-error);
  background-color: #FFFDFD;
}
.field-error-message {
  display: none;
  font-size: 0.8125rem;
  color: var(--color-error);
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.form-group.has-error .field-error-message {
  display: flex;
}

/* --- Role Selection UI --- */
.role-selector {
  display: flex;
  gap: var(--space-tight);
}
.role-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1.5px solid var(--color-input-border);
  border-radius: var(--radius-input);
  background: var(--color-surface-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
  min-height: 72px;
}
.role-card svg {
  width: 24px;
  height: 24px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  transition: all var(--transition-normal);
}
.role-card span {
  font-size: 0.875rem;
  font-weight: var(--weight-label);
  color: var(--color-text-secondary);
}
.role-card input[type="radio"] { display: none; }
.role-card.active {
  border-color: var(--color-brand-primary);
  background: var(--color-soft-brand);
}
.role-card.active svg {
  color: var(--color-brand-primary);
  transform: scale(1.08);
}
.role-card.active span {
  color: var(--color-text-label);
}

/* --- OTP UI --- */
.otp-ui-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: var(--space-related);
  width: 100%;
}
.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: var(--weight-heading);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-input);
  background: var(--color-input-bg);
  transition: all var(--transition-fast);
  outline: none;
}
.otp-digit:focus {
  border-color: var(--color-focus);
  background: var(--color-surface-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}
.otp-resend {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-major);
}
.otp-resend button {
  background: none;
  border: none;
  color: var(--color-focus);
  font-weight: var(--weight-label);
  cursor: pointer;
  padding: 4px;
}
.otp-resend button:disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* --- Buttons --- */
.btn-primary-auth {
  width: 100%;
  min-height: 48px;
  background: var(--color-brand-gradient);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: var(--weight-button);
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-button);
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: 4px;
}
.btn-primary-auth:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-button-hover);
}
.btn-primary-auth:active {
  transform: scale(0.98);
}
.btn-primary-auth:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
.btn-primary-auth:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: cw-spin 0.8s linear infinite;
}
@keyframes cw-spin {
  to { transform: rotate(360deg); }
}
.btn-primary-auth.is-loading .spinner { display: inline-block; }
.btn-primary-auth.is-loading .btn-text { opacity: 0.8; }

/* --- Secondary switch CTA --- */
.btn-secondary-switch {
  background: transparent;
  border: none;
  font-size: 0.875rem;
  font-weight: var(--weight-label);
  color: var(--color-focus);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  min-height: 44px;
  width: 100%;
}
.btn-secondary-switch:hover {
  background: var(--color-inactive-surface);
}

/* --- Feedback Banner --- */
.auth-alert-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  background: #FFF;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.875rem;
  font-weight: var(--weight-label);
}
.auth-alert-banner.show { transform: translateX(-50%) translateY(0); }
.auth-alert-banner.error { color: var(--color-error); border-left: 4px solid var(--color-error); }
.auth-alert-banner.success { color: var(--color-success); border-left: 4px solid var(--color-success); }
.auth-alert-banner svg { width: 20px; height: 20px; }


/* ==========================================================================
   COUNTRY SELECTOR MODAL
   ========================================================================== */
.country-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end; /* Mobile bottom-sheet feel by default */
  justify-content: center;
  background: rgba(17, 24, 47, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal);
}
.country-modal.active {
  opacity: 1;
  visibility: visible;
}

.country-modal-content {
  background: var(--color-surface-primary);
  width: 100%;
  max-width: 480px;
  height: 90vh; /* Takes most of the screen */
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  overflow: hidden;
}
.country-modal.active .country-modal-content {
  transform: translateY(0);
}

@media (min-width: 600px) {
  .country-modal {
    align-items: center;
    padding: 24px;
  }
  .country-modal-content {
    height: 600px;
    max-height: 85vh;
    border-radius: 24px;
    transform: scale(0.95);
  }
  .country-modal.active .country-modal-content {
    transform: scale(1);
  }
}

.country-modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-input-border);
}

.btn-close-modal {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-primary);
  padding: 8px;
  margin-left: -8px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
}
.btn-close-modal:hover { background: var(--color-inactive-surface); }

.country-modal-title {
  font-size: 1.125rem;
  font-weight: var(--weight-heading);
  color: var(--color-text-primary);
  flex: 1;
}

.country-search-container {
  padding: 12px 20px;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-input-border);
}
.country-search-container .search-icon {
  position: absolute;
  left: 32px;
  color: var(--color-text-muted);
}
.country-search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-input);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  background: var(--color-input-bg);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}
.country-search-input:focus { border-color: var(--color-focus); }

.country-list-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.country-list-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 24px 0;
}
.country-list-container::-webkit-scrollbar { width: 6px; }
.country-list-container::-webkit-scrollbar-thumb { background: rgba(73, 55, 112, 0.2); border-radius: 4px; }

.country-section-title {
  padding: 12px 20px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  background: var(--color-page-bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.country-row {
  display: flex;
  align-items: center;
  padding: 12px 32px 12px 20px; /* Right padding for alphabet index */
  min-height: 48px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
  transition: background var(--transition-fast);
}
.country-row:hover, .country-row:focus-visible {
  background: var(--color-inactive-surface);
  outline: none;
}
.country-row-flag {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 2px;
  margin-right: 12px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.country-row-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}
.country-row-dial {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.alphabet-index {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 8px 4px;
}
.alpha-jump {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-focus);
  padding: 1px 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
}
.alpha-jump:hover {
  background: var(--color-inactive-surface);
  border-radius: 4px;
}

/* --- Desktop Enhancements --- */
@media (min-width: 768px) {
  .auth-card {
    padding: var(--space-major) 24px;
    border-radius: 24px;
  }
  .form-title {
    font-size: 1.375rem;
  }
}

/* --- Premium Logo Animation --- */
.premium-sparkle-wrapper {
  position: relative;
  display: inline-block;
  animation: logoScaleIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes logoScaleIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Subtle sparkling droplets (water-like, purple-pink) */
.premium-sparkle-wrapper::before {
  content: '';
  position: absolute;
  top: -20px; left: -20px; right: -20px; bottom: -20px;
  background-image: 
    radial-gradient(circle, rgba(168, 60, 240, 0.8) 15%, transparent 40%), /* 1. upper-left */
    radial-gradient(circle, rgba(236, 72, 153, 0.8) 15%, transparent 40%), /* 2. upper-right */
    radial-gradient(circle, rgba(124, 58, 237, 0.7) 15%, transparent 40%), /* 3. left-middle */
    radial-gradient(circle, rgba(236, 72, 153, 0.7) 15%, transparent 40%), /* 4. right-middle */
    radial-gradient(circle, rgba(168, 60, 240, 0.8) 15%, transparent 40%), /* 5. lower-left-mid */
    radial-gradient(circle, rgba(124, 58, 237, 0.8) 15%, transparent 40%), /* 6. lower-right-mid */
    radial-gradient(circle, rgba(236, 72, 153, 0.8) 15%, transparent 40%), /* 7. bottom-left */
    radial-gradient(circle, rgba(168, 60, 240, 0.7) 15%, transparent 40%), /* 8. bottom-right */
    radial-gradient(circle, rgba(124, 58, 237, 0.8) 15%, transparent 40%); /* 9. top-center */
  background-position: 
    10% 15%, 88% 12%, 6% 35%, 94% 38%, 8% 65%, 92% 62%, 18% 85%, 82% 88%, 50% 8%;
  background-repeat: no-repeat;
  animation: randomDropletFades 8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes randomDropletFades {
  0%, 100% {
    background-size: 
      12px 12px, 0px 0px, 0px 0px, 14px 14px, 0px 0px, 0px 0px, 10px 10px, 0px 0px, 14px 14px;
  }
  20% {
    background-size: 
      0px 0px, 16px 16px, 0px 0px, 0px 0px, 12px 12px, 0px 0px, 0px 0px, 14px 14px, 0px 0px;
  }
  40% {
    background-size: 
      0px 0px, 0px 0px, 18px 18px, 0px 0px, 0px 0px, 14px 14px, 12px 12px, 0px 0px, 0px 0px;
  }
  60% {
    background-size: 
      10px 10px, 0px 0px, 0px 0px, 12px 12px, 0px 0px, 0px 0px, 0px 0px, 16px 16px, 12px 12px;
  }
  80% {
    background-size: 
      0px 0px, 14px 14px, 10px 10px, 0px 0px, 16px 16px, 12px 12px, 0px 0px, 0px 0px, 0px 0px;
  }
}

/* Connected smooth light sweep */
.premium-sparkle-wrapper::after {
  content: '';
  position: absolute;
  top: -5px; left: -5px; right: -5px; bottom: -5px; /* Slight expansion for soft bloom bleed */
  background: linear-gradient(105deg, 
    transparent 10%, 
    rgba(255, 255, 255, 0.1) 30%, 
    rgba(255, 255, 255, 0.5) 45%, 
    rgba(255, 255, 255, 0.9) 50%, /* Bright glossy core */
    rgba(255, 255, 255, 0.5) 55%, 
    rgba(255, 255, 255, 0.1) 70%, 
    transparent 90%
  );
  background-size: 200% 100%;
  animation: elegantSweep 6.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: 12px;
}

@keyframes elegantSweep {
  0% { background-position: 200% 0; opacity: 0; }
  10% { opacity: 1; }
  40% { background-position: -100% 0; opacity: 0; }
  100% { background-position: -100% 0; opacity: 0; }
}
