:root {
  --bg-base: #0f0c15;
  --bg-surface: #171422;
  --bg-surface-elevated: #211c30;
  --bg-card: rgba(26, 22, 39, 0.75);
  
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f0f0f5;
  --text-muted: #9590a8;
  --text-dim: #68637e;

  --primary: #e50914;
  --primary-hover: #f40612;
  --primary-glow: rgba(229, 9, 20, 0.35);

  --secondary: #2c273e;
  --secondary-hover: #3a3452;

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* BACKGROUND GLOW ORBS */
.background-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: #e50914;
  top: -150px;
  left: 20%;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: #6366f1;
  bottom: -100px;
  right: 15%;
}

.app-container {
  width: 100%;
  max-width: 1100px;
  padding: 2rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* HEADER & BRAND */
.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.35);
  overflow: hidden;
  padding: 4px;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.brand-info {
  text-align: left;
}

.brand-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff 0%, #38bdf8 50%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

/* RESPONSIVE TEXT TOGGLES */
.desktop-text {
  display: inline;
}

.mobile-text {
  display: none;
}

/* NAVIGATION TABS */
.portal-tabs,
.portal-nav {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  padding: 0.35rem;
  border-radius: 50px;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn,
.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover,
.nav-btn:hover {
  color: var(--text);
}

.tab-btn.active,
.nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* PORTAL PANES */
.portal-pane {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PRICING SECTION */
.pricing-header {
  text-align: center;
  margin-bottom: 2rem;
}

.badge-pill {
  display: inline-block;
  background: rgba(229, 9, 20, 0.15);
  color: #ff4b55;
  border: 1px solid rgba(229, 9, 20, 0.3);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.pricing-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

/* IMPORTANT PLAN NOTICE BANNER */
.important-plan-notice {
  margin: 1.25rem auto 0 auto;
  max-width: 840px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(20, 16, 30, 0.92) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-left: 5px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), 0 0 20px rgba(245, 158, 11, 0.15);
  backdrop-filter: blur(12px);
}

.notice-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  line-height: 1;
}

.notice-body {
  flex: 1;
}

.notice-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.notice-body p {
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

.notice-body strong {
  color: #fff;
  font-weight: 700;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.pricing-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pricing-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.pricing-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.1) 0%, rgba(26, 22, 39, 0.85) 100%);
  box-shadow: 0 0 25px rgba(229, 9, 20, 0.2);
}

.popular-ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.popular-ribbon.value {
  background: #8b5cf6;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
}

.card-plan-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.card-price {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.card-price .currency {
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.card-price .unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.plan-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.plan-features strong {
  color: #fff;
}

/* PANE BOX / FORMS */
.pane-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pane-box.pane-box-wide {
  max-width: 1060px;
  width: 100%;
}

.pane-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.pane-intro h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.action-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.flex-1 { flex: 1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.req { color: var(--primary); }

input[type="email"],
input[type="text"] {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line-strong);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn.full { width: 100%; }

.btn-lg {
  padding: 0.9rem 1.6rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid var(--line-strong);
}

.btn-outline:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--text);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px var(--success-glow);
}

.btn-success:hover {
  background: #0ea371;
}

.btn-copy-mini {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-copy-mini:hover {
  color: #fff;
  border-color: #fff;
}

/* RESULTS & CARDS */
.result-box {
  margin-top: 1.75rem;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.result-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-align: center;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.badge-success {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: 0.5px;
}

.badge-warning {
  font-size: 0.8rem;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.5px;
}

.parse-error-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-top: 0.5rem;
}

.parse-error-notice p {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.parse-error-notice ol {
  margin: 0.5rem 0 0 1.2rem;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.parse-error-notice ol li {
  margin-bottom: 0.3rem;
}


.credentials-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.cred-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cred-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  width: 140px;
}

.cred-val {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  flex: 1;
}

.cred-val.highlight {
  font-family: var(--font-mono);
  color: #60a5fa;
}

.profile-badge {
  background: var(--primary);
  color: #fff;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-block;
  width: fit-content;
}

.pin-badge {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: #34d399;
  letter-spacing: 2px;
}

.instructions-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.25rem;
}

.instructions-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
}

.instructions-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.instructions-card ol {
  padding-left: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.result-actions .btn { flex: 1; }

/* QUOTA PREVIEW */
.quota-preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.quota-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.quota-progress-bar {
  height: 8px;
  background: var(--bg-surface-elevated);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.quota-progress-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s ease, background 0.3s ease;
}

/* OTP LINK DISPLAY */
.otp-action-box {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.otp-link-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.otp-link-text {
  font-family: var(--font-mono);
  color: #60a5fa;
  text-decoration: underline;
  word-break: break-all;
}

.otp-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.highlight-code {
  background: var(--bg-surface-elevated);
  color: #60a5fa;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* FOOTER */
.app-footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-link {
  color: var(--text-muted);
  text-decoration: underline;
}

.admin-link:hover { color: #fff; }

/* MODALS & CHECKOUT */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.checkout-card {
  max-width: 540px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

/* PLAN SUMMARY BANNER */
.plan-summary-banner {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.15) 0%, rgba(30, 41, 59, 0.5) 100%);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* VIETQR PAYMENT CONTAINER */
.qr-payment-container {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

@media (max-width: 520px) {
  .qr-payment-container {
    flex-direction: column;
  }
}

.qr-code-wrapper {
  background: #fff;
  padding: 6px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.vietqr-img {
  width: 190px;
  height: auto;
  display: block;
  border-radius: 4px;
}

.bank-details-box {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
  font-size: 0.88rem;
}

.bank-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.highlight-val {
  font-family: var(--font-mono);
  color: #60a5fa;
  font-size: 1rem;
}

.highlight-code-large {
  background: var(--primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}

.text-danger { color: #f87171 !important; font-size: 1.1rem; }

.polling-status-box {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.86rem;
  color: #93c5fd;
}

.spinner-mini {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(147, 197, 253, 0.3);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* MODE SUBTABS FOR CODE GATE */
.mode-subtabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.subtab-btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subtab-btn:hover {
  background: var(--bg-surface-elevated);
  color: #fff;
}

.subtab-btn.active {
  background: rgba(229, 9, 20, 0.15);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.25);
}

.info-callout {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #93c5fd;
}

/* DIRECT IN-APP OTP & HOUSEHOLD DISPLAYS */
.direct-otp-container {
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.otp-code-highlight {
  font-size: 2.5rem;
  font-family: var(--font-mono);
  font-weight: 900;
  letter-spacing: 8px;
  color: #fff;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.25) 0%, rgba(20, 20, 20, 0.8) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.5rem;
  margin: 0.75rem auto;
  display: inline-block;
  box-shadow: 0 0 30px rgba(229, 9, 20, 0.4);
  text-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
  animation: pulse 2s infinite ease-in-out;
}

.direct-household-container {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(20, 20, 20, 0.6) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.household-success-badge {
  font-weight: 800;
  color: #10b981;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.btn-glow {
  box-shadow: 0 0 25px rgba(229, 9, 20, 0.5);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.mail-details-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.mail-preview-body {
  max-height: 320px;
  overflow-y: auto;
  background: #ffffff;
  color: #1f2937;
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* SPINNER & UTILITIES */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.8rem; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }

/* === CENTER-SCREEN TOAST NOTIFICATIONS === */
#toast-container {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 10000;
  pointer-events: none;
  width: 90%;
  max-width: 520px;
}

.toast {
  pointer-events: auto;
  background: rgba(26, 22, 39, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastCenterPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  line-height: 1.4;
}

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
}

.toast-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(26, 22, 39, 0.95) 100%);
  border-color: #10b981;
  color: #ecfdf5;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(16, 185, 129, 0.45);
}

.toast-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(26, 22, 39, 0.95) 100%);
  border-color: #ef4444;
  color: #fef2f2;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(239, 68, 68, 0.45);
}

.toast-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(26, 22, 39, 0.95) 100%);
  border-color: #3b82f6;
  color: #eff6ff;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(59, 130, 246, 0.45);
}

@keyframes toastCenterPop {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(-15px) scale(0.92);
  transition: all 0.3s ease;
}

/* MODE SUB-TABS (Single Line 3 Modes) */
.mode-subtabs {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  margin-bottom: 1.5rem;
}

.subtab-btn {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.75rem 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subtab-btn:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.subtab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}


/* QR COUNTDOWN BADGE */
.qr-countdown-container {
  margin-top: -0.25rem;
}

.qr-countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
}

.countdown-timer {
  color: #ef4444;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: 1px;
}

.countdown-timer.urgent {
  color: #ff2222;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
  animation: pulseUrgent 0.8s infinite alternate;
}

@keyframes pulseUrgent {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(1.1); opacity: 1; }
}

/* MODERN 5-STEP VIP INSTRUCTIONS */
.instructions-steps-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.instruction-step-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: all 0.2s ease;
}

.instruction-step-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.instruction-step-card.highlight-step {
  border-color: rgba(229, 9, 20, 0.45);
  background: rgba(229, 9, 20, 0.08);
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.12);
}

.step-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.step-1 { background: #2563eb; color: #fff; }
.step-2 { background: #7c3aed; color: #fff; }
.step-3 { background: #0891b2; color: #fff; }
.step-4 { background: #059669; color: #fff; }
.step-5 { background: #e50914; color: #fff; box-shadow: 0 0 10px rgba(229, 9, 20, 0.5); }

.step-content {
  flex: 1;
}

.step-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.step-desc {
  font-size: 0.86rem;
  color: #d1d5db;
  line-height: 1.5;
}

.highlight-code {
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  border: 1px solid rgba(147, 197, 253, 0.25);
}

.badge-tag-netflix {
  background: rgba(229, 9, 20, 0.18);
  color: #ff6b74;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(229, 9, 20, 0.35);
  font-weight: 700;
}

.badge-tag-otp {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-weight: 700;
}

.badge-tag-action {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.profile-name-tag {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.92rem;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.pin-code-large {
  background: linear-gradient(135deg, #e50914, #b91c1c);
  color: #fff;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 0.15rem 0.65rem;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 0 14px rgba(229, 9, 20, 0.5);
  margin-left: 0.2rem;
}

.vip-notice-banner {
  display: flex;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  align-items: center;
  color: #fef08a;
  font-size: 0.85rem;
  line-height: 1.45;
}

.vip-notice-banner strong {
  color: #facc15;
}

/* === 2-COLUMN SPLIT LAYOUT & MULTI-PROFILE CTV PORTAL === */
.badge-ctv {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.multi-profile-tabs-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.profile-tabs-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.86rem;
  color: #e5e7eb;
}

.profile-tabs-list {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.profile-tab-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d1d5db;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.profile-tab-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.profile-tab-item.active {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.25), rgba(229, 9, 20, 0.1));
  border-color: #e50914;
  color: #fff;
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.35);
}

.profile-tab-item .tab-pin {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  color: #facc15;
  font-size: 0.8rem;
}

/* 2-Column Split Layout (Left: Credentials, Right: Instructions) */
.lookup-split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

@media (max-width: 860px) {
  .lookup-split-layout {
    grid-template-columns: 1fr;
  }
}

.lookup-col-left, .lookup-col-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lookup-col-left .credentials-card,
.lookup-col-right .instructions-card {
  display: flex;
  flex-direction: column;
}

.card-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #f3f4f6;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Order History Section */
.order-history-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 0.5rem;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  transition: background 0.2s ease;
}

.history-card-header:hover {
  background: rgba(255, 255, 255, 0.07);
}

.history-icon {
  font-size: 1.1rem;
}

.badge-count {
  background: rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-toggle-history-view {
  background: transparent;
  border: none;
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.history-table-wrapper {
  padding: 0.5rem;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.history-table th {
  padding: 0.6rem 0.8rem;
  color: #9ca3af;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.history-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  vertical-align: middle;
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.history-status-active {
  color: #34d399;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.history-status-expired {
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ctv-checkout-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fef08a;
  font-size: 0.82rem;
  line-height: 1.4;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.ctv-checkout-banner .ctv-icon {
  font-size: 1.25rem;
}

/* === PROMOTIONAL & SHOP STOREFRONT BANNERS === */
.promo-banners-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

@media (max-width: 820px) {
  .promo-banners-container {
    grid-template-columns: 1fr;
  }
}

.promo-banner-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.promo-banner-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.promo-gift-card {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12) 0%, rgba(26, 22, 39, 0.85) 100%);
  border-color: rgba(234, 179, 8, 0.35);
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.15);
}

.promo-gift-card:hover {
  border-color: #facc15;
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.3);
}

.promo-shop-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(26, 22, 39, 0.85) 100%);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.promo-shop-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
}

.promo-badge-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.promo-badge-tag.shop-tag {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.promo-card-content h3 {
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.promo-card-content p {
  font-size: 0.86rem;
  color: #d1d5db;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.promo-card-actions {
  margin-top: auto;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
  color: #fff;
}

/* === 2-COLUMN SPLIT LAYOUT FOR OTP & HOUSEHOLD GATE === */
/* === 2-COLUMN SPLIT LAYOUT FOR OTP & HOUSEHOLD GATE === */
.otp-split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .otp-split-layout {
    grid-template-columns: 1fr;
  }
}

.otp-col-left, .otp-col-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.otp-col-left .credentials-card {
  display: flex;
  flex-direction: column;
}

/* HIGH-CONTRAST NEON OTP DISPLAY */
.direct-otp-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.08) 0%, rgba(20, 16, 32, 0.8) 100%);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 20px rgba(229, 9, 20, 0.1);
}

.otp-code-highlight {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(229, 9, 20, 0.8), 0 0 35px rgba(229, 9, 20, 0.5);
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.25) 0%, rgba(15, 12, 21, 0.95) 100%);
  border: 2px solid #e50914;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.75rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(229, 9, 20, 0.35), inset 0 0 15px rgba(229, 9, 20, 0.2);
  user-select: all;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.otp-code-highlight:active {
  transform: scale(0.98);
}

/* SMART TV 1-CLICK BUTTON */
.direct-household-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, rgba(20, 16, 32, 0.8) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-lg);
  gap: 0.75rem;
}

.household-success-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.btn-glow {
  background: linear-gradient(135deg, #e50914 0%, #b91c1c 100%) !important;
  color: #fff !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: 0 0 25px rgba(229, 9, 20, 0.6), 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(229, 9, 20, 0.5); transform: translateY(0); }
  50% { box-shadow: 0 0 35px rgba(229, 9, 20, 0.85); transform: translateY(-2px); }
}

/* EMAIL VIEWER CARD */
.otp-mail-viewer-card {
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.mail-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.5rem;
}

.badge-live-mail {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.mail-viewer-body {
  padding: 1.15rem;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 520px;
  background: #ffffff;
  color: #111827;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.mail-preview-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  width: 100%;
}

.mail-preview-body table {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.mail-preview-body td, 
.mail-preview-body th {
  word-break: break-word !important;
}

.mail-preview-body img {
  max-width: 100% !important;
  height: auto !important;
}

.mail-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: #6b7280;
  gap: 0.6rem;
}

.mail-empty-icon {
  font-size: 2.8rem;
}

/* ==========================================================================
   MOBILE RESPONSIVE SYSTEM (Super Sleek & Touch-Optimized for Smartphones)
   ========================================================================== */

@media (max-width: 900px) {
  /* RESPONSIVE TEXT SWITCHING */
  .desktop-text {
    display: none !important;
  }
  
  .mobile-text {
    display: inline !important;
  }

  /* CONTAINER & BASE */
  .app-container {
    padding: 0.85rem 0.65rem 3rem;
    gap: 1.15rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* HEADER & BRAND */
  .app-header {
    gap: 0.85rem;
  }

  .brand {
    gap: 0.65rem;
  }

  .brand-logo-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    padding: 3px;
  }

  .brand-title {
    font-size: 1.35rem;
    letter-spacing: 0.2px;
    line-height: 1.2;
  }

  .brand-subtitle {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  /* PORTAL NAV TABS - 3 EQUAL PERFECT COLUMNS (NO DRAGGING / NO OVERFLOW) */
  .portal-nav {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    overflow: hidden;
    box-sizing: border-box;
  }

  .nav-btn {
    width: 100%;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.52rem 0.15rem;
    border-radius: 9px;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  .nav-btn .nav-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  /* SUB-TABS (OTP MODES) - 3 EQUAL PERFECT COLUMNS (NO DRAGGING / NO OVERFLOW) */
  .mode-subtabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 4px;
    margin-bottom: 1rem;
    box-sizing: border-box;
  }

  .subtab-btn {
    width: 100%;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.52rem 0.15rem;
    border-radius: 8px;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  .subtab-btn .subtab-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  /* PANE BOX & CARDS */
  .pane-box {
    padding: 1.1rem 0.85rem;
    border-radius: var(--radius-lg);
    width: 100%;
    box-sizing: border-box;
  }

  .pane-intro {
    margin-bottom: 1rem;
  }

  .pane-intro h2 {
    font-size: 1.22rem;
    line-height: 1.35;
    margin-bottom: 0.35rem;
  }

  .pane-intro p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  /* FORM LAYOUTS */
  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-group label {
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
  }

  input[type="email"],
  input[type="text"],
  input[type="tel"] {
    font-size: 0.88rem;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    width: 100%;
  }

  /* SLEEK BUTTON SIZING & ERGONOMICS */
  .btn {
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.62rem 1rem;
    border-radius: 10px;
    gap: 0.4rem;
  }

  .btn-lg {
    padding: 0.72rem 1.2rem;
    font-size: 0.92rem;
    border-radius: 10px;
  }

  .btn-sm {
    padding: 0.38rem 0.7rem;
    font-size: 0.76rem;
    border-radius: 7px;
  }

  .btn-copy-mini {
    padding: 0.22rem 0.48rem;
    font-size: 0.72rem;
    border-radius: 6px;
    flex-shrink: 0;
  }

  button:active, .btn:active, .nav-btn:active, .subtab-btn:active {
    transform: scale(0.98);
  }

  /* PRICING HEADER & GRID */
  .pricing-header {
    margin-bottom: 1.25rem;
  }

  .pricing-header h2 {
    font-size: 1.32rem;
    line-height: 1.3;
    margin-bottom: 0.35rem;
  }

  .pricing-header p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .pricing-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }

  .card-plan-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.45rem;
  }

  .card-price .currency {
    font-size: 1.65rem;
  }

  .card-price .unit {
    font-size: 0.8rem;
  }

  .plan-sub {
    font-size: 0.76rem;
    margin-bottom: 1rem;
  }

  .plan-features {
    gap: 0.45rem;
    font-size: 0.82rem;
    margin-bottom: 1.2rem;
  }

  .popular-ribbon {
    font-size: 0.65rem;
    padding: 0.2rem 0.65rem;
    top: -10px;
  }

  .btn-buy-plan {
    padding: 0.62rem 1rem;
    font-size: 0.86rem;
  }

  /* IMPORTANT PLAN NOTICE BANNER */
  .important-plan-notice {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    gap: 0.45rem;
    border-radius: var(--radius-md);
    margin-top: 0.85rem;
  }

  .notice-icon {
    font-size: 1.3rem;
  }

  .notice-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    margin-bottom: 0.25rem;
  }

  .notice-body p {
    font-size: 0.8rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* SPLIT LAYOUTS */
  .lookup-split-layout,
  .otp-split-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* CREDENTIALS CARDS & ROWS (NO OVERFLOW) */
  .credentials-card,
  .instructions-card {
    padding: 0.95rem 0.85rem;
    border-radius: var(--radius-md);
    gap: 0.55rem;
    margin-bottom: 0.95rem;
    box-sizing: border-box;
    overflow: hidden;
  }

  .card-section-title {
    font-size: 0.82rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.4rem;
  }

  .cred-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .cred-row:last-child {
    border-bottom: none;
  }

  .cred-label {
    width: auto;
    min-width: 105px;
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  .cred-val {
    font-size: 0.86rem;
    word-break: break-all;
    overflow-wrap: anywhere;
    flex: 1;
    text-align: right;
  }

  .cred-val.highlight {
    font-size: 0.82rem;
  }

  .cred-val.pin-badge {
    font-size: 1.05rem;
    letter-spacing: 1.5px;
  }

  .profile-badge {
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
  }

  .result-actions {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .result-actions .btn {
    width: 100%;
  }

  /* OTP BIG CODE DISPLAY */
  .direct-otp-container {
    padding: 1rem 0.85rem;
    border-radius: var(--radius-md);
    gap: 0.55rem;
  }

  .otp-code-highlight {
    font-size: 1.85rem;
    letter-spacing: 4px;
    padding: 0.6rem 1rem;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
  }

  /* SMART TV HOUSEHOLD CONFIRMATION */
  .direct-household-container {
    padding: 1rem 0.85rem;
    border-radius: var(--radius-md);
    gap: 0.55rem;
  }

  .household-success-badge {
    font-size: 0.92rem;
  }

  .btn-glow {
    font-size: 0.88rem !important;
    padding: 0.72rem 1rem !important;
    border-radius: 10px !important;
    letter-spacing: 0.2px;
    word-break: break-word;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  /* EMAIL VIEWER (FLUID AND SCROLLABLE) */
  .otp-mail-viewer-card {
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .mail-viewer-header {
    padding: 0.65rem 0.85rem;
    gap: 0.4rem;
  }

  .mail-viewer-body {
    padding: 0.75rem;
    max-height: 380px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    width: 100%;
  }

  .mail-preview-body {
    font-size: 0.84rem;
    line-height: 1.5;
    width: 100%;
  }

  .mail-preview-body table {
    max-width: 100% !important;
    width: 100% !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
  }

  .mail-preview-body img {
    max-width: 100% !important;
    height: auto !important;
  }

  .mail-preview-body td,
  .mail-preview-body th {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    font-size: 0.8rem !important;
  }

  /* INSTRUCTIONS CARDS */
  .instruction-step-card {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
  }

  .step-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }

  .step-title {
    font-size: 0.85rem;
  }

  .step-desc {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  /* PROMO BANNERS */
  .promo-banners-container {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1.25rem;
  }

  .promo-banner-card {
    padding: 1.1rem 0.95rem;
    border-radius: var(--radius-lg);
  }

  .promo-card-content h3 {
    font-size: 0.98rem;
    line-height: 1.35;
  }

  .promo-card-content p {
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 0.75rem;
  }

  .promo-card-actions .btn {
    font-size: 0.78rem;
    padding: 0.48rem 0.75rem;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
    word-break: break-all;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  /* MULTI-PROFILE TABS (CTV) */
  .multi-profile-tabs-container {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .profile-tabs-list {
    gap: 0.4rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .profile-tab-item {
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 7px;
  }

  /* ORDER HISTORY TABLE */
  .order-history-card {
    border-radius: var(--radius-md);
  }

  .history-card-header {
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
  }

  .history-table-wrapper {
    padding: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .history-table {
    font-size: 0.74rem;
    min-width: 520px;
  }

  .history-table th, 
  .history-table td {
    padding: 0.45rem 0.55rem;
  }

  /* MODAL CHECKOUT */
  .modal-overlay {
    padding: 0.65rem;
  }

  .modal-card {
    width: calc(100vw - 1.3rem) !important;
    max-width: 480px !important;
    max-height: 92vh !important;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 0.85rem 1.1rem;
  }

  .modal-header h3 {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(92vh - 120px);
  }

  .modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .plan-summary-banner {
    padding: 0.75rem 0.85rem;
  }

  .plan-summary-banner h4 {
    font-size: 1rem !important;
  }

  .plan-summary-banner h3 {
    font-size: 1.25rem !important;
  }

  .qr-countdown-badge {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
  }

  .qr-payment-container {
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
  }

  .vietqr-img {
    max-width: 180px;
    width: 100%;
    height: auto;
  }

  .bank-details-box {
    width: 100%;
    padding: 0.75rem;
    gap: 0.45rem;
    font-size: 0.82rem;
  }

  .bank-info-row {
    font-size: 0.8rem;
  }

  .highlight-val {
    font-size: 0.92rem;
  }

  .highlight-code-large {
    font-size: 0.95rem;
    padding: 0.12rem 0.45rem;
  }

  .polling-status-box {
    padding: 0.6rem 0.85rem;
    font-size: 0.78rem;
  }

  /* TOAST NOTIFICATIONS */
  #toast-container {
    top: 1rem;
    width: 92%;
    max-width: 380px;
  }

  .toast {
    font-size: 0.82rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 1.22rem;
  }
  
  .card-price .currency {
    font-size: 1.55rem;
  }
  
  .otp-code-highlight {
    font-size: 1.7rem;
    letter-spacing: 3px;
    padding: 0.55rem 0.85rem;
  }

  .btn-copy-mini {
    padding: 0.18rem 0.45rem;
    font-size: 0.7rem;
  }

  .nav-btn {
    font-size: 0.74rem;
    padding: 0.46rem 0.1rem;
    gap: 0.15rem;
  }

  .nav-btn .nav-icon {
    font-size: 0.82rem;
  }

  .subtab-btn {
    font-size: 0.7rem;
    padding: 0.46rem 0.1rem;
    gap: 0.15rem;
  }

  .subtab-btn .subtab-icon {
    font-size: 0.78rem;
  }
}

@media (max-width: 360px) {
  .nav-btn {
    font-size: 0.68rem;
    padding: 0.42rem 0.05rem;
    gap: 0.1rem;
  }

  .nav-btn .nav-icon {
    font-size: 0.74rem;
  }

  .subtab-btn {
    font-size: 0.65rem;
    padding: 0.42rem 0.05rem;
    gap: 0.08rem;
  }

  .subtab-btn .subtab-icon {
    font-size: 0.72rem;
  }
}

/* Mail Viewing Modal */
.mail-modal-card {
  max-width: 680px;
  width: 95%;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.mail-modal-card .modal-body {
  background: #181818;
}

#modal-mail-content-html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

#modal-mail-content-html a {
  word-break: break-all;
}

