/* ═══════════════════════════════════════════════════════════════════════════
   LAYER 3 CO-LOCATED STYLES: LoginView (`components/auth/LoginView.css`)
   Webxtek Chatbot (`Login.module.css`) & AtletIQ Liquid Glass Auth System
   ═══════════════════════════════════════════════════════════════════════════ */

.wxt-auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-root);
  position: relative;
  overflow: hidden;
}

/* Decorative ambient gradient orbs (Webxtek Chatbot auth.css standard) */
.wxt-auth-page::before,
.wxt-auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
}

.wxt-auth-page::before {
  width: 520px;
  height: 520px;
  background: var(--accent);
  top: -160px;
  right: -110px;
}

.wxt-auth-page::after {
  width: 440px;
  height: 440px;
  background: var(--emerald);
  bottom: -120px;
  left: -110px;
}

.wxt-auth-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
}

.wxt-auth-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.wxt-auth-topbar-badge {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.wxt-auth-card {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 2;
  margin: auto;
  animation: agxFadeInUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.wxt-auth-card-inner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 45%, rgba(0, 0, 0, 0.3) 100%), var(--bg-surface);
  backdrop-filter: var(--liquid-blur);
  -webkit-backdrop-filter: var(--liquid-blur);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  padding: 32px;
}

.wxt-auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.wxt-auth-brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1d9bf0 0%, #06b6d4 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 24px rgba(29, 155, 240, 0.38), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.wxt-auth-brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: block;
}

.wxt-auth-brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

/* Segmented Mode Tabs (Webxtek Chatbot Login.module.css) */
.wxt-mode-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
}

.wxt-mode-tab-btn {
  flex: 1;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  color: var(--text-secondary);
}

.wxt-mode-tab-btn:hover {
  color: var(--text-primary);
}

.wxt-mode-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(29, 155, 240, 0.32);
}

.wxt-form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.x-field-group {
  margin-bottom: 4px;
}

.x-field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.x-input {
  width: 100%;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text-primary);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.x-input::placeholder {
  color: var(--text-muted);
}

.x-input.has-lead-icon {
  padding-left: 40px;
}

.x-input:focus {
  border-color: var(--accent);
  background: var(--bg-surface-solid);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.22);
}

.otp-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.32em;
}

.wxt-auth-submit-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1d9bf0 0%, #06b6d4 100%);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 20px rgba(29, 155, 240, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.wxt-auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(29, 155, 240, 0.44), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.wxt-auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wxt-auth-security-box {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(29, 155, 240, 0.07);
  border: 1px solid rgba(29, 155, 240, 0.22);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wxt-auth-security-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.wxt-auth-security-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.wxt-auth-security-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── 6-DIGIT SPLIT OTP BOXES & LIVE COUNTDOWN TIMER ──────────────────────── */
.x-otp-header-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.x-otp-sent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.x-otp-channel-icon {
  color: var(--accent);
  display: inline-flex;
}

.x-otp-timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.x-otp-clock-icon {
  color: var(--accent);
  display: inline-flex;
}

.x-otp-timer-text {
  color: var(--emerald);
  font-weight: 700;
}

.x-otp-timer-text.is-warning {
  color: var(--amber);
}

.x-otp-timer-text.is-expired {
  color: var(--danger);
}

.x-otp-timer-track {
  margin-top: 8px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.x-otp-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--accent));
  border-radius: 9999px;
  transition: width 0.4s linear;
}

.x-otp-timer-fill.is-warning {
  background: var(--amber);
}

.x-otp-timer-fill.is-expired {
  background: var(--danger);
}

.x-otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.x-otp-digit {
  width: 100%;
  height: 54px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.x-otp-digit:focus {
  border-color: var(--accent);
  background: var(--bg-surface-solid);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.25);
}

.x-otp-footer-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.x-btn-outline-pill {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.x-btn-outline-pill:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-strong);
}

.x-btn-outline-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.x-btn-text-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.x-btn-text-link:hover {
  color: var(--accent);
}

/* ─── COUNTRY SELECTOR & INPUT ICONS (RULE 4: TIER 4 SOLID DROPDOWN) ──────── */
.phone-input-group {
  display: flex;
  gap: 8px;
  position: relative;
}

.country-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 112px;
  justify-content: space-between;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.country-trigger:hover,
.country-trigger.is-open {
  border-color: var(--accent);
  background: var(--bg-surface-solid);
}

.country-prefix-code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
}

.country-chevron {
  color: var(--text-secondary);
  transition: transform 0.18s ease;
}

.country-chevron.is-open {
  transform: rotate(180deg);
  color: var(--accent);
}

.phone-number-field {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  z-index: var(--z-dropdown);
  padding: 6px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75);
}

.country-dropdown-head {
  padding: 6px 10px 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.country-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.country-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.country-option.is-selected {
  background: var(--accent-soft);
  color: #7dd3fc;
}

.country-option-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.country-option-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.country-option-prefix {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.country-option-check {
  color: var(--accent);
  display: inline-flex;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-lead-icon {
  position: absolute;
  left: 13px;
  color: var(--text-secondary);
  display: inline-flex;
  pointer-events: none;
}

.auth-dev-code {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--emerald);
}

/* ─── MODAL OVERLAY & SOLID SURFACE CARD (Webxtek Modal.module.css Rule 4) ── */
.wxt-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: agxScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wxt-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.wxt-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wxt-modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wxt-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wxt-modal-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.wxt-modal-body {
  padding: 20px 22px;
}

.wxt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 520px) {
  .wxt-auth-card-inner {
    padding: 24px 18px;
  }
  .x-otp-digit {
    height: 46px;
    font-size: 19px;
  }
}
