:root {
  /* Warm Beige & Electric Lime Theme Tokens */
  --bg-sand: #eae4d9;
  --bg-card: #ffffff;
  --bg-dark: #0e1013;
  --bg-dark-card: #16191e;
  --text-main: #0a0c0f;
  --text-muted: #5e5950;
  --text-light: #f8fafc;
  --accent-lime: #baf238;
  --accent-lime-hover: #a3e616;
  --accent-lime-dark: #84cc16;
  --accent-lime-tint: #f3fde0;
  --border-sand: #d8cfc0;
  --border-dark: #272c35;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius-card: 24px;
  --radius-md: 12px;
  --radius-pill: 9999px;
  --shadow-theme: 0 24px 48px -12px rgba(14, 16, 19, 0.15);
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-sand);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Viewport Container */
.app-viewport {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

/* Header */
.app-header {
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.brand .badge {
  font-size: 0.72rem;
  background-color: var(--accent-lime);
  color: var(--text-main);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(186, 242, 56, 0.4);
}

/* Main Container Card */
.card-container {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-sand);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-theme);
  padding: 2.5rem 2.25rem;
  position: relative;
  overflow: hidden;
}

/* View Panels */
.view-panel {
  display: none;
  animation: slideFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-panel.active {
  display: block;
}

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

/* Card Header */
.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.subheading {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
}

.shield-badge, .otp-badge {
  width: 54px;
  height: 54px;
  background-color: var(--accent-lime-tint);
  border: 1px solid rgba(186, 242, 56, 0.6);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(186, 242, 56, 0.25);
}

.selected-provider-badge {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 4px 12px;
  background-color: var(--accent-lime-tint);
  border: 1px solid rgba(186, 242, 56, 0.6);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Page 1: Swipe Slider */
.challenge-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 60px;
  background-color: #f3eee5;
  border: 1px solid var(--border-sand);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background-color: var(--accent-lime);
  border-radius: var(--radius-pill);
  transition: width 0.05s linear;
}

.slider-track.verified .slider-fill {
  background-color: var(--accent-lime);
}

.slider-text {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  pointer-events: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.slider-track.verified .slider-text {
  color: #0a0c0f;
}

.slider-handle {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 50px;
  height: 50px;
  background-color: var(--bg-dark);
  color: var(--accent-lime);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(14, 16, 19, 0.25);
  cursor: grab;
  z-index: 2;
  border: 2px solid var(--bg-dark);
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.slider-handle:active {
  cursor: grabbing;
  transform: scale(1.03);
}

.handle-icon {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent-lime);
  transition: transform 0.2s ease;
}

.slider-track.verified .slider-handle {
  background-color: var(--accent-lime);
  border-color: var(--accent-lime);
  cursor: default;
}

.slider-track.verified .handle-icon {
  color: var(--bg-dark);
}

.status-msg {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  min-height: 1.4rem;
  color: #15803d;
}

/* Provider Card Grid */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.provider-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.1rem 0.75rem;
  background-color: #faf8f5;
  border: 2px solid var(--border-sand);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.provider-card.full-width {
  grid-column: span 2;
  flex-direction: row;
  gap: 0.75rem;
  padding: 0.9rem;
}

.provider-card:hover {
  border-color: var(--bg-dark);
  background-color: #ffffff;
}

.provider-card.selected {
  border-color: var(--accent-lime-dark);
  background-color: var(--accent-lime-tint);
  box-shadow: 0 4px 14px rgba(186, 242, 56, 0.4);
}

.provider-icon {
  font-size: 1.5rem;
}

.provider-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.input-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.98rem;
  font-weight: 500;
  border: 1.5px solid var(--border-sand);
  border-radius: var(--radius-md);
  background-color: #faf8f5;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input.read-only-input[readonly] {
  background-color: #f0ebe1;
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border-sand);
}

input:focus:not([readonly]) {
  border-color: var(--bg-dark);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(186, 242, 56, 0.45);
}

.error-msg {
  display: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--danger);
  margin-top: 0.2rem;
}

.global-error-msg {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--danger);
  background-color: var(--danger-bg);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(220, 38, 38, 0.2);
  margin-bottom: 1.1rem;
  display: none;
  text-align: center;
}

.global-error-msg.visible {
  display: block;
}

/* Summary Cards & Info Rows */
.summary-card {
  background-color: #faf8f5;
  border: 1px solid var(--border-sand);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-bottom: 1.75rem;
}

.summary-card.compact {
  padding: 1rem 1.2rem;
}

.summary-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  font-weight: 800;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border-sand);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.info-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 0.9rem 1.4rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none !important;
}

.btn:active:not([disabled]) {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--accent-lime);
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(186, 242, 56, 0.45);
}

.btn-primary:hover:not([disabled]) {
  background-color: var(--accent-lime-hover);
  box-shadow: 0 6px 18px rgba(186, 242, 56, 0.55);
}

.btn-secondary {
  background-color: #f0ebe1;
  color: var(--text-main);
  border: 1px solid var(--border-sand);
}

.btn-secondary:hover:not([disabled]) {
  background-color: #e5dfd2;
}

.button-group {
  display: flex;
  gap: 0.75rem;
}

.button-group .btn {
  flex: 1;
}

/* App Dialog Modals */
.app-dialog {
  border: none;
  border-radius: var(--radius-card);
  padding: 0;
  box-shadow: 0 25px 50px -12px rgba(14, 16, 19, 0.35);
  max-width: 420px;
  width: 90vw;
  margin: auto;
  background: transparent;
  outline: none;
}

.app-dialog::backdrop {
  background-color: rgba(14, 16, 19, 0.65);
  backdrop-filter: blur(6px);
}

.dialog-content {
  padding: 2rem 1.75rem;
  background: #ffffff;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-sand);
}

.dialog-content.text-center {
  text-align: center;
}

.modal-header {
  margin-bottom: 1.25rem;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

/* Referral Loader Animation (No Countdown Text) */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 0.5rem 0;
  gap: 1.25rem;
}

.spinner-ring {
  width: 70px;
  height: 70px;
  border: 5px solid #f0ebe1;
  border-top: 5px solid var(--accent-lime-dark);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-status {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Session Timeout View */
.timeout-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.timeout-icon-badge {
  width: 70px;
  height: 70px;
  background-color: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0 auto 1.1rem auto;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.25);
}

.summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 600;
}

.item-label {
  color: var(--text-main);
}

.item-status {
  font-weight: 800;
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.item-status.status-pass {
  color: var(--text-main);
  background-color: var(--accent-lime);
}

.item-status.status-timeout {
  color: #92400e;
  background-color: #fef3c7;
}

/* Footer */
.app-footer {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}
