/* ===========================
   APPLE-NATIVE DESIGN TOKENS
   =========================== */
:root {
    /* Apple system colors */
    --apple-blue: #007AFF;
    --apple-green: #34C759;
    --apple-indigo: #5856D6;
    --apple-orange: #FF9500;
    --apple-red: #FF3B30;
    --apple-purple: #AF52DE;
    --apple-pink: #FF2D55;
    --apple-teal: #5AC8FA;
    --apple-mint: #00C7BE;

    /* Surfaces */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --bg-grouped: #F2F2F7;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-solid: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.6);

    /* Text */
    --text-primary: #000000;
    --text-secondary: #3C3C43;
    --text-tertiary: #8E8E93;
    --text-quaternary: #AEAEB2;

    /* Borders & Dividers */
    --separator: rgba(60, 60, 67, 0.12);
    --separator-opaque: #C6C6C8;
    --border-glass: rgba(255, 255, 255, 0.5);

    /* System font stack (SF Pro) */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 100px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);

    /* Transitions */
    --transition-fast: 0.18s ease;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-spring: 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.3);
}

/* ===========================
   ONBOARDING SCREEN
   =========================== */
.onboarding-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ob-skip {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    z-index: 10;
    padding: 0.5rem;
    transition: color var(--transition-fast);
}

.ob-skip:hover {
    color: var(--apple-blue);
}

.ob-slides-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ob-slides-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.ob-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 0;
    text-align: center;
}

.ob-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-top: 2rem;
}

.ob-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 0.75rem;
    max-width: 340px;
    opacity: 0.85;
}

/* Slide 1 — Phone Transfer Visual */
.ob-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
}

.ob-visual-1 {
    gap: 1rem;
}

.ob-phone {
    position: relative;
}

@keyframes obPhoneFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.ob-phone-left {
    animation: obPhoneFloat 3s ease-in-out infinite;
}

.ob-phone-right {
    animation: obPhoneFloat 3s ease-in-out infinite 0.5s;
}

.ob-data-dots {
    position: absolute;
    top: 35%;
    left: 50%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@keyframes obDotFly {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100px);
    }
}

.ob-data-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--apple-blue);
    animation: obDotFly 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.3s);
    opacity: 0;
}

.ob-transfer-arrow {
    animation: obPhoneFloat 2s ease-in-out infinite 0.25s;
}

/* Slide 2 — Carrier Showcase */
.ob-visual-2 {
    flex-direction: column;
    gap: 1.5rem;
}

.ob-carrier-showcase {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 320px;
}

@keyframes obBubblePop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.ob-carrier-bubble {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color);
    background: color-mix(in srgb, var(--color) 10%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--color) 25%, transparent);
    animation: obBubblePop 0.5s ease-out backwards;
    animation-delay: var(--delay);
}

.ob-direction-badges {
    display: flex;
    gap: 0.75rem;
}

.ob-dir-badge {
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
}

.ob-dir-a2i {
    background: linear-gradient(135deg, rgba(61, 220, 132, 0.12), rgba(0, 122, 255, 0.12));
    color: #3DDC84;
    border: 1px solid rgba(61, 220, 132, 0.25);
}

.ob-dir-i2a {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(61, 220, 132, 0.12));
    color: #007AFF;
    border: 1px solid rgba(0, 122, 255, 0.25);
}

/* Slide 3 — Security Shield */
.ob-visual-3 {
    flex-direction: column;
    gap: 1.25rem;
}

.ob-shield {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes obShieldCheck {
    0% {
        stroke-dashoffset: 64;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

.ob-shield-check {
    stroke-dasharray: 64;
    stroke-dashoffset: 64;
    animation: obShieldCheck 1s ease-out 0.5s forwards;
}

@keyframes obRingPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.ob-shield-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid #34C759;
    animation: obRingPulse 2s ease-out infinite;
}

.ob-security-pills {
    display: flex;
    gap: 0.5rem;
}

@keyframes obPillSlide {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.ob-pill {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    color: #34C759;
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.2);
    animation: obPillSlide 0.4s ease-out backwards;
    animation-delay: var(--delay);
}

/* Pagination */
.ob-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.ob-dots {
    display: flex;
    gap: 0.5rem;
}

.ob-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--separator-opaque);
    transition: all var(--transition-smooth);
}

.ob-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--apple-blue);
}

.ob-next-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--apple-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.7rem 1.25rem;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ob-next-btn:hover {
    background: #0066DD;
}

.ob-next-btn:active {
    transform: scale(0.96);
}

/* ===========================
   PAYWALL SCREEN
   =========================== */
.paywall-screen {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.pw-container {
    max-width: 420px;
    width: 100%;
    padding: 2rem 1.5rem;
    text-align: center;
    animation: fadeUp 0.5s ease-out;
}

.pw-hero {
    margin-bottom: 1.5rem;
}

.pw-icon {
    margin-bottom: 0.75rem;
}

.pw-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.pw-gradient-text {
    background: linear-gradient(135deg, #007AFF, #5856D6, #AF52DE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pw-subtitle {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

/* Features */
.pw-features {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
    margin-bottom: 1.75rem;
    padding: 0 0.5rem;
}

.pw-feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 500;
}

.pw-feature svg {
    flex-shrink: 0;
}

/* One-time Price Hero */
.pw-price-hero {
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.06), rgba(88, 86, 214, 0.06));
    border: 1.5px solid rgba(0, 122, 255, 0.15);
}

.pw-price-amount {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #007AFF, #5856D6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.pw-price-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.35rem;
}

.pw-price-note {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}


/* CTA */
.pw-cta {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    letter-spacing: -0.01em;
}

.pw-cta:hover {
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}

.pw-cta:active {
    transform: scale(0.98);
}

.pw-restore {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.75rem;
    padding: 0.5rem;
    transition: color var(--transition-fast);
}

.pw-restore:hover {
    color: var(--apple-blue);
}

.pw-legal {
    font-size: 0.7rem;
    color: var(--text-quaternary);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.pw-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.7rem;
}

.pw-legal-links a {
    color: var(--apple-blue);
    text-decoration: none;
    font-weight: 500;
}

.pw-legal-links a:hover {
    text-decoration: underline;
}

.pw-legal-sep {
    color: var(--text-quaternary);
}



/* ===========================
   DARK MODE OVERRIDES
   =========================== */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-grouped: #000000;
    --bg-card: rgba(28, 28, 30, 0.72);
    --bg-card-solid: #1C1C1E;
    --bg-glass: rgba(28, 28, 30, 0.65);

    --text-primary: #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.85);
    --text-tertiary: #A1A1A6;
    --text-quaternary: #7C7C80;

    --separator: rgba(84, 84, 88, 0.36);
    --separator-opaque: #48484A;
    --border-glass: rgba(84, 84, 88, 0.4);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .step-card::before {
    background: linear-gradient(90deg, transparent 10%, rgba(255, 255, 255, 0.08) 50%, transparent 90%);
}

[data-theme="dark"] .checkbox-custom {
    background: #2C2C2E;
}

[data-theme="dark"] .step-nav {
    background: rgba(28, 28, 30, 0.88);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .direction-option.selected,
[data-theme="dark"] .carrier-option.selected {
    background: rgba(0, 122, 255, 0.12);
}

/* Brighten dark brand colors for dark mode readability */
[data-theme="dark"] .carrier-option[data-carrier="US Cellular"] span {
    color: #5A8ABF !important;
}

[data-theme="dark"] .carrier-option[data-carrier="Metro by T-Mobile"] span {
    color: #9B6BC4 !important;
}

[data-theme="dark"] .carrier-option[data-carrier="Visible"] span {
    color: #7B77D1 !important;
}

[data-theme="dark"] .carrier-option[data-carrier="Same Carrier"] span {
    color: #A1A1A6 !important;
}

/* ===========================
   THEME TOGGLE
   =========================== */
.theme-toggle {
    position: absolute;
    top: 1.25rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--separator);
    background: var(--bg-card-solid);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    z-index: 50;
    padding: 0;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:active {
    transform: scale(0.9);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ===========================
   RESET & BASE
   =========================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-grouped);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ===========================
   CONFETTI CANVAS
   =========================== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

#confetti-canvas.active {
    opacity: 1;
}

/* ===========================
   APP CONTAINER
   =========================== */
.app-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 1rem 1rem 6rem;
    min-height: 100vh;
}

/* ===========================
   SETUP SCREEN (Carrier/Direction Selection)
   =========================== */
.setup-screen {
    animation: fadeUp 0.5s ease-out;
}

.setup-screen .step-card {
    text-align: center;
}

.setup-section {
    margin-top: 1.5rem;
    text-align: left;
}

.setup-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
    padding-left: 0.25rem;
}

/* Direction Selector */
.direction-selector {
    display: flex;
    gap: 0.75rem;
}

.direction-option {
    flex: 1;
    padding: 1rem 0.75rem;
    border: 2px solid var(--separator);
    border-radius: var(--radius-lg);
    background: var(--bg-card-solid);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-smooth);
    position: relative;
}

.direction-option:hover {
    border-color: var(--separator-opaque);
    box-shadow: var(--shadow-sm);
}

.direction-option.selected {
    border-color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.04);
    box-shadow: 0 0 0 1px var(--apple-blue);
}

.direction-option .dir-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-top: 0.5rem;
}

.direction-option .dir-sub {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

.direction-option .dir-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Carrier Selector */
.carrier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.carrier-option {
    padding: 0.75rem;
    border: 2px solid var(--separator);
    border-radius: var(--radius-md);
    background: var(--bg-card-solid);
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-smooth);
}

.carrier-option:hover {
    border-color: var(--separator-opaque);
}

.carrier-option.selected {
    border-color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.04);
    box-shadow: 0 0 0 1px var(--apple-blue);
    font-weight: 600;
}

.carrier-option .carrier-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.35rem;
    vertical-align: middle;
}

/* Begin Button */
.btn-begin {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--apple-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.btn-begin:hover {
    background: #0066DD;
}

.btn-begin:active {
    transform: scale(0.98);
}

.btn-begin:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===========================
   HEADER
   =========================== */
.app-header {
    text-align: center;
    padding: 1.25rem 0 0.75rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.logo-phone {
    color: var(--text-tertiary);
}

.app-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.tagline {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 400;
    margin-top: 0.1rem;
}

/* ===========================
   PROGRESS BAR
   =========================== */
.progress-container {
    margin: 0.75rem 0;
}

.progress-bar {
    height: 4px;
    background: var(--separator);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--apple-blue), var(--apple-green));
    border-radius: var(--radius-pill);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.75rem;
}

#progressPercent {
    font-weight: 600;
    color: var(--apple-blue);
}

#progressLabel {
    color: var(--text-tertiary);
}

/* ===========================
   STEP INDICATORS
   =========================== */
.step-indicators {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.75rem 0 1.25rem;
}

.step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-card-solid);
    border: 1.5px solid var(--separator-opaque);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all var(--transition-smooth);
    cursor: pointer;
}

.step-dot.active {
    background: var(--apple-blue);
    border-color: var(--apple-blue);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.step-dot.completed {
    background: var(--apple-green);
    border-color: var(--apple-green);
    color: #fff;
}

.step-dot.completed span {
    display: none;
}

.step-dot.completed::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

/* ===========================
   STEPS
   =========================== */
.steps-wrapper {
    overflow: hidden;
    position: relative;
}

.steps-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.step {
    min-width: 100%;
    opacity: 0;
    transform: scale(0.97);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.step.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

/* ===========================
   STEP CARD — LIQUID GLASS
   =========================== */
.step-card {
    background: var(--bg-glass);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glass), 0 12px 40px rgba(0, 0, 0, 0.08);
}

.step-card:active {
    transform: translateY(-2px) scale(0.995);
}

/* Liquid glass shimmer highlight */
.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(255, 255, 255, 0.9) 50%, transparent 90%);
}

.welcome-card {
    text-align: center;
}

.step-icon-large {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.step-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.step-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
    opacity: 0.8;
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}

/* ===========================
   INFO BOX
   =========================== */
.info-box {
    background: var(--bg-card-solid);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin: 1rem auto;
    max-width: 320px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
}

.info-row+.info-row {
    border-top: 1px solid var(--separator);
}

.info-row .label {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    font-weight: 500;
}

.info-row .value {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* ===========================
   TIP & WARNING BOXES
   =========================== */
.tip-box {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: rgba(0, 122, 255, 0.05);
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin: 0.75rem 0;
}

.tip-icon-svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.tip-box p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: rgba(255, 149, 0, 0.06);
    border: 1px solid rgba(255, 149, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin: 0 0 1.25rem;
}

.warning-icon-svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.warning-box p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* ===========================
   CHECKLIST
   =========================== */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.checklist-item:hover {
    background: var(--bg-secondary);
}

.checklist-item:active {
    transform: scale(0.99);
}

.checklist-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    border: 2px solid var(--separator-opaque);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-bounce);
    margin-top: 1px;
}

.checkbox-custom::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px) scale(0);
    transition: transform var(--transition-bounce);
}

.checklist-item input:checked~.checkbox-custom {
    background: var(--apple-green);
    border-color: var(--apple-green);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.25);
}

.checklist-item input:checked~.checkbox-custom::after {
    transform: rotate(-45deg) translateY(-1px) scale(1);
}

.checklist-item input:checked~.checklist-content strong {
    color: var(--apple-green);
}

.checklist-item input:checked~.checklist-content {
    opacity: 0.65;
}

.checklist-content strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.checklist-content p {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.4;
}

/* ===========================
   APP GRID & ALTERNATIVES
   =========================== */
.section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.app-chip {
    background: var(--bg-card-solid);
    border: 1px solid var(--separator);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.app-chip:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.app-alternatives {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.alt-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card-solid);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    border: 1px solid var(--separator);
}

.alt-android {
    color: var(--text-tertiary);
    min-width: 125px;
    font-size: 0.78rem;
}

.alt-arrow {
    color: var(--apple-blue);
    font-weight: 600;
}

.alt-ios {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.78rem;
}

/* ===========================
   COMPLETION SUMMARY
   =========================== */
/* ===========================
   COMPLETION RING
   =========================== */
.completion-ring-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.completion-ring {
    transform: rotate(-90deg);
    filter: drop-shadow(0 2px 8px rgba(0, 122, 255, 0.2));
}

.completion-ring-bg {
    fill: none;
    stroke: var(--separator);
    stroke-width: 6;
}

.completion-ring-fill {
    fill: none;
    stroke: url(#ringGrad);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.completion-ring-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.completion-ring-percent {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--apple-blue), var(--apple-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.completion-ring-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

.completion-summary {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin: 1.5rem 0;
}

.summary-stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--apple-blue);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* ===========================
   DONE CARD
   =========================== */
.done-card h2 {
    color: var(--text-primary);
}

/* ===========================
   NAVIGATION — Apple Native Buttons
   =========================== */
.step-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(242, 242, 247, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 0.5px solid var(--separator);
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 560px;
    margin: 0 auto;
    z-index: 100;
}

.btn {
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.7rem 1.25rem;
}

.btn:active {
    transform: scale(0.96);
}

.btn-next {
    background: var(--apple-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
    margin-left: auto;
}

.btn-next:hover {
    background: #0066DD;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.btn-back {
    background: transparent;
    color: var(--apple-blue);
    padding: 0.7rem 0.75rem;
}

.btn-back:hover {
    background: rgba(0, 122, 255, 0.06);
}

.btn-back:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    background: var(--bg-card-solid);
    color: var(--text-secondary);
    border: 1px solid var(--separator);
    margin-top: 1rem;
    font-size: 0.85rem;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

/* ===========================
   HIDDEN STATE
   =========================== */
.hidden {
    display: none !important;
}

/* ===========================
   ANIMATIONS — Premium
   =========================== */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceCheck {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.25);
    }

    50% {
        transform: scale(0.9);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(0, 122, 255, 0);
    }
}

@keyframes celebratePop {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }

    50% {
        transform: scale(1.15) rotate(3deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1.5);
    }
}

/* Parallax depth transition */
.step {
    transition: opacity 0.4s, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step:not(.active) {
    opacity: 0;
    pointer-events: none;
}

.step.active .step-card {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Skeleton shimmer on step load */
.step.active .step-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: skeletonSweep 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

@keyframes skeletonSweep {
    0% {
        left: -100%;
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Step title typewriter */
.step.active h2 {
    animation: typeReveal 0.6s ease-out;
}

@keyframes typeReveal {
    0% {
        opacity: 0;
        letter-spacing: 0.1em;
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        letter-spacing: -0.03em;
        filter: blur(0);
    }
}

/* Stagger checklist items */
.step.active .checklist-item {
    opacity: 0;
    animation: fadeUp 0.4s ease-out forwards;
}

.step.active .checklist-item:nth-child(1) {
    animation-delay: 0.05s;
}

.step.active .checklist-item:nth-child(2) {
    animation-delay: 0.1s;
}

.step.active .checklist-item:nth-child(3) {
    animation-delay: 0.15s;
}

.step.active .checklist-item:nth-child(4) {
    animation-delay: 0.2s;
}

.step.active .checklist-item:nth-child(5) {
    animation-delay: 0.25s;
}

.step.active .checklist-item:nth-child(6) {
    animation-delay: 0.3s;
}

.step.active .checklist-item:nth-child(7) {
    animation-delay: 0.35s;
}

.step.active .checklist-item:nth-child(8) {
    animation-delay: 0.4s;
}

/* Checkbox bounce on check */
.checklist-item input:checked~.checkbox-custom {
    animation: bounceCheck 0.45s ease-out;
}

/* ===========================
   TAP RIPPLE — Haptic Motion
   =========================== */
@keyframes rippleEffect {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.35;
    }

    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

.tap-ripple {
    position: absolute;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    background: var(--apple-blue);
    opacity: 0;
    pointer-events: none;
    animation: rippleEffect 0.5s ease-out forwards;
}

.carrier-option,
.direction-option,
.btn,
.btn-begin,
.checklist-item,
.faq-question,
.faq-card,
.troubleshoot-toggle,
.step-dot,
.theme-toggle {
    position: relative;
    overflow: hidden;
}

/* ===========================
   TIME ESTIMATE BADGE
   =========================== */
.time-estimate {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0.5rem;
    background: linear-gradient(270deg, #007AFF, #5856D6, #AF52DE, #34C759, #007AFF);
    background-size: 400% 100%;
    animation: timerGradientFlow 4s ease infinite;
    box-shadow: 0 2px 12px rgba(0, 122, 255, 0.25);
    transition: all var(--transition-smooth);
}

@keyframes timerGradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.time-estimate svg {
    flex-shrink: 0;
    color: #fff;
}

.time-estimate.almost-done {
    background: linear-gradient(270deg, #34C759, #30D158, #5AC8FA, #34C759);
    background-size: 400% 100%;
    animation: timerGradientFlow 3s ease infinite;
    box-shadow: 0 2px 12px rgba(52, 199, 89, 0.3);
}

/* ===========================
   RESUME TOAST
   =========================== */
.resume-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-card-solid);
    border: 1px solid var(--separator);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 200;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 380px;
    width: calc(100% - 2rem);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.resume-toast.visible {
    transform: translateX(-50%) translateY(0);
}

.resume-toast-text {
    flex: 1;
}

.resume-toast-text strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

.resume-toast-text span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.resume-toast-btn {
    background: var(--apple-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.resume-toast-btn:hover {
    background: #0066DD;
}

.resume-toast-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-quaternary);
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
}

/* ===========================
   MILESTONE CELEBRATION
   =========================== */
.milestone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.milestone-overlay.active {
    opacity: 1;
}

.milestone-badge {
    background: var(--bg-card-solid);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: celebratePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.milestone-badge .milestone-percent {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--apple-blue), var(--apple-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.milestone-badge .milestone-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Floating emoji-like particles for milestones */
.float-particle {
    position: fixed;
    pointer-events: none;
    font-size: 1.5rem;
    z-index: 301;
    animation: floatUp 1.2s ease-out forwards;
}

/* ===========================
   TROUBLESHOOTING SECTION
   =========================== */
.troubleshoot-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--separator);
    padding-top: 1rem;
}

.troubleshoot-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    font-family: var(--font-family);
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.troubleshoot-toggle svg {
    transition: transform var(--transition-smooth);
    color: var(--text-quaternary);
}

.troubleshoot-toggle.open svg {
    transform: rotate(180deg);
}

.troubleshoot-items {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.troubleshoot-items.open {
    display: flex;
    animation: fadeUp 0.3s ease-out;
}

.faq-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

.faq-question svg {
    flex-shrink: 0;
    transition: transform var(--transition-smooth);
    color: var(--text-quaternary);
}

.faq-question.open svg {
    transform: rotate(45deg);
    color: var(--apple-blue);
}

.faq-answer {
    display: none;
    padding: 0 0.9rem 0.7rem;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.faq-answer.open {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* ===========================
   STEP NAV SHIMMER (loading feel)
   =========================== */
.btn-next.pulse {
    animation: pulseGlow 2s infinite;
}

/* ===========================
   PROGRESS BAR — Animated gradient
   =========================== */
.progress-fill {
    background: linear-gradient(90deg, var(--apple-blue), var(--apple-teal), var(--apple-green), var(--apple-blue));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 480px) {
    .app-container {
        padding: 0.75rem 0.75rem 5.5rem;
    }

    .step-card {
        padding: 1.5rem 1.1rem;
    }

    .app-header h1 {
        font-size: 1.5rem;
    }

    .step-card h2 {
        font-size: 1.3rem;
    }

    .alt-android {
        min-width: 100px;
        font-size: 0.75rem;
    }

    .alt-ios {
        font-size: 0.75rem;
    }

    .step-dot {
        width: 26px;
        height: 26px;
        font-size: 0.65rem;
    }

    .direction-selector {
        flex-direction: column;
    }
}

@media (min-width: 768px) {
    .app-container {
        padding: 2rem 1.5rem 6rem;
    }

    .step-card {
        padding: 2rem 1.75rem;
    }
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ===========================
   SELECTION
   =========================== */
::selection {
    background: rgba(0, 122, 255, 0.15);
    color: var(--text-primary);
}