/* ========================================
   Full Pack Australia - Wizard Form
   YoMeAnimo! Brand Tokens
   ======================================== */

:root {
    --magenta: #DC3D54;
    --magenta-light: rgba(220, 61, 84, 0.08);
    --magenta-glow: rgba(220, 61, 84, 0.18);
    --teal: #2BC4C4;
    --teal-light: rgba(43, 196, 196, 0.10);
    --violet: #653B65;
    --violet-dark: #580044;
    --yellow: #F5A623;
    --yellow-light: rgba(245, 166, 35, 0.10);
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F7;
    --gray-200: #E8E8ED;
    --gray-400: #9B9BA7;
    --gray-600: #6B6B76;
    --gray-800: #2D2D3A;
    --gray-900: #1A1A2E;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 100px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);

    --nav-height: 56px;
    --progress-height: 36px;
    --bottom-nav: 80px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100dvh;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; color: var(--gray-900); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font-body); border: none; cursor: pointer; background: none; }
select { font-family: var(--font-body); }

/* --- Header --- */
.form-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--nav-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}
.logo img { height: 28px; }
.header-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--magenta);
    background: var(--magenta-light);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
}

/* --- Progress --- */
.progress-wrapper {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 99;
    height: var(--progress-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.progress-bar::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, var(--magenta), var(--violet));
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-400);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

/* --- Wizard --- */
.wizard {
    padding-top: calc(var(--nav-height) + var(--progress-height) + 24px);
    padding-bottom: calc(var(--bottom-nav) + 24px);
    min-height: 100dvh;
}
.step {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}
.step.active { display: block; }

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

.step-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
}

.step-label {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--magenta);
    margin-bottom: 8px;
}

.step h2 {
    font-size: clamp(1.6rem, 5vw, 2rem);
    margin-bottom: 8px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--magenta), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-desc {
    font-size: 0.95rem;
    color: var(--gray-600);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* --- Chips (nationality) --- */
.chips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 28px;
}
.chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
    transition: all 0.2s ease;
    text-align: left;
}
.chip:hover { border-color: var(--gray-400); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chip.selected {
    border-color: var(--magenta);
    background: var(--magenta-light);
    color: var(--gray-900);
    box-shadow: 0 0 0 3px var(--magenta-glow);
}
.chip-flag { font-size: 1.3rem; line-height: 1; }

/* Last chip spans full width if odd (for nationality grid) */
.chips-grid .chip:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}
/* Second passport grid: always 3 columns, no full-width last item */
#secondPassportChips { grid-template-columns: repeat(3, 1fr) !important; }
#secondPassportChips .chip:last-child:nth-child(odd) { grid-column: auto; }

/* --- Age chips --- */
.chip-age {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px 12px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    cursor: pointer;
}
.chip-age:hover { border-color: var(--gray-400); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chip-age.selected {
    border-color: var(--magenta);
    background: var(--magenta-light);
    box-shadow: 0 0 0 3px var(--magenta-glow);
}
.chip-age-range {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}
.chip-age.selected .chip-age-range { color: var(--magenta); }
.chip-age-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 500;
}
.field-sublabel {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 10px;
    line-height: 1.4;
}

/* --- Small chips (date, exam) --- */
.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip-sm {
    padding: 10px 16px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.chip-sm:hover { border-color: var(--gray-400); }
.chip-sm.selected {
    border-color: var(--magenta);
    background: var(--magenta-light);
    color: var(--magenta);
    font-weight: 600;
}

/* --- Field group --- */
.field-group {
    margin-bottom: 24px;
}
.field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
}
.field-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 6px;
}
.field-hint.warning { color: var(--yellow); }
.field-hint.error { color: var(--magenta); }
.field-error {
    display: block;
    font-size: 0.78rem;
    color: var(--magenta);
    margin-top: 4px;
    min-height: 18px;
}

/* --- Select --- */
.select-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    color: var(--gray-800);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239B9BA7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
    transition: border-color 0.2s;
}
.select-input:focus {
    outline: none;
    border-color: var(--magenta);
    box-shadow: 0 0 0 3px var(--magenta-glow);
}

/* --- Radio cards --- */
.radio-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.radio-card { cursor: pointer; }
.radio-card input { display: none; }
.radio-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    flex-wrap: wrap;
}
.radio-card-inner:hover { border-color: var(--gray-400); }
.radio-card input:checked + .radio-card-inner {
    border-color: var(--magenta);
    background: var(--magenta-light);
    box-shadow: 0 0 0 3px var(--magenta-glow);
}
.radio-card-icon { font-size: 1.4rem; flex-shrink: 0; }
.radio-card-title { font-weight: 600; font-size: 0.9rem; color: var(--gray-900); }
.radio-card-desc {
    font-size: 0.78rem;
    color: var(--gray-400);
    width: 100%;
    padding-left: 40px;
    margin-top: -4px;
}

/* --- English level pills --- */
.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.seg-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: calc(50% - 5px);
    padding: 18px 12px;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
    transition: all 0.2s ease;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
}
.seg-btn:hover { border-color: var(--gray-400); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.seg-btn.selected {
    background: var(--magenta-light);
    color: var(--magenta);
    border-color: var(--magenta);
    box-shadow: 0 0 0 3px var(--magenta-glow);
}
/* Last pill (5th = Avanzado) spans full width */
.seg-btn:last-child:nth-child(odd) {
    flex: 1 1 100%;
    min-width: 100%;
}
.seg-label { pointer-events: none; }

/* --- Text inputs (floating label) --- */
.input-wrapper {
    position: relative;
}
.text-input {
    width: 100%;
    padding: 24px 16px 10px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    color: var(--gray-800);
    transition: border-color 0.2s;
    outline: none;
}
.text-input:focus {
    border-color: var(--magenta);
    box-shadow: 0 0 0 3px var(--magenta-glow);
}
.text-input.input-error {
    border-color: var(--magenta) !important;
    box-shadow: 0 0 0 3px rgba(220, 61, 84, 0.12) !important;
}
.text-input.valid {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-light);
}
.floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--gray-400);
    pointer-events: none;
    transition: all 0.2s ease;
}
.text-input:focus + .floating-label,
.text-input:not(:placeholder-shown) + .floating-label {
    top: 8px;
    transform: translateY(0);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--magenta);
    letter-spacing: 0.3px;
}
.text-input.valid:not(:placeholder-shown) + .floating-label {
    color: var(--teal);
}
.input-check {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--teal);
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 700;
}
.input-check.visible { opacity: 1; }

/* Phone input — intl-tel-input integration */
.phone-wrapper { position: relative; }
.phone-wrapper .iti { width: 100%; }
.phone-wrapper .iti .iti__selected-dial-code { font-size: 1rem; font-weight: 600; color: var(--gray-800); }
.phone-wrapper .iti__country-container { z-index: 10; padding-top: 4px; padding-left: 6px; transition: padding-top 0.2s ease; }
.phone-wrapper.has-value .iti__country-container,
.phone-wrapper.focused .iti__country-container { padding-top: 14px; }
.text-input--phone { padding-left: 100px !important; }
.floating-label--phone { left: 100px; }
/* intl-tel-input wraps the input, breaking the + selector. Use JS class instead */
.phone-wrapper.focused .floating-label--phone,
.phone-wrapper.has-value .floating-label--phone {
    top: 8px;
    transform: translateY(0);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    left: 16px;
}
.phone-wrapper.focused .floating-label--phone { color: var(--magenta); }
.phone-wrapper.has-value .floating-label--phone { color: var(--magenta); }
.phone-wrapper.has-value.valid .floating-label--phone { color: var(--teal); }
/* Match intl-tel-input dropdown with design system */
.iti__dropdown-content { border-radius: var(--radius-md); border: 1px solid var(--gray-200); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.iti__search-input { font-family: var(--font-body); font-size: 0.9rem; border-radius: var(--radius-sm); }
.iti__country-list { font-family: var(--font-body); }
.iti__highlight { background-color: var(--magenta-light) !important; }
.iti__active { background-color: var(--magenta-light) !important; }

/* --- Discount toggle --- */
.discount-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-400);
    padding: 8px 0;
    transition: color 0.2s;
}
.discount-toggle:hover { color: var(--gray-600); }
.discount-toggle svg { transition: transform 0.2s; }
.discount-toggle.open svg { transform: rotate(180deg); }
.discount-field {
    margin-top: 8px;
    animation: fadeSlideIn 0.3s ease;
}

/* --- Route cards --- */
.routing-content { text-align: center; }
.route-card { padding: 8px 0; }
.route-icon { margin: 0 auto 20px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.route-congrats { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.01em; }
.route-img-placeholder { width: 100%; display: flex; align-items: center; justify-content: center; margin: -30px auto 0; max-width: 420px; }
.route-img-placeholder img { width: 100%; max-width: 420px; height: auto; display: block; }
.route-card h2 { font-size: clamp(1.4rem, 4.5vw, 1.8rem); margin-bottom: 12px; }
.route-desc { font-size: 0.95rem; color: var(--gray-600); line-height: 1.5; max-width: 380px; margin: 0 auto 20px; }
.route-desc strong { color: var(--gray-900); font-weight: 700; }
.x-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--magenta);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: -3px;
}

.route-highlight {
    background: linear-gradient(135deg, var(--violet-dark), var(--violet));
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    color: var(--white);
    margin: 20px 0;
}
.route-price { display: block; font-family: var(--font-heading); font-size: 0.9rem; }
.route-price strong { font-size: 2.2rem; font-weight: 800; }
.route-save { display: block; font-size: 0.78rem; opacity: 0.7; margin-top: 4px; }

.route-tips {
    background: var(--yellow-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: left;
    margin: 16px 0;
}
.route-tips p {
    font-size: 0.85rem;
    color: var(--gray-800);
    line-height: 1.5;
}
.route-tips p + p { margin-top: 8px; }

/* Alternatives (red route) */
.alt-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin: 16px 0;
}
.alt-section-title {
    font-size: 0.82rem;
    color: var(--gray-600);
    margin: 0 0 8px;
    text-align: left;
    width: 100%;
    flex-basis: 100%;
}
.alt-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}
/* Recommended alt card */
.alt-card--recommended {
    border-color: var(--teal) !important;
    background: var(--white) !important;
}
.alt-recommended-badge {
    background: var(--teal);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    letter-spacing: 0.3px;
    width: fit-content;
    order: -1;
    flex-basis: 100%;
}
.alt-card--link:hover {
    border-color: var(--magenta);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.alt-icon { font-size: 1.5rem; flex-shrink: 0; }
.alt-card strong {
    font-size: 0.95rem;
    color: var(--gray-900);
    flex: 1;
    min-width: 0;
}
.alt-card p {
    width: 100%;
    font-size: 0.82rem;
    color: var(--gray-600);
    margin: 0;
    padding-left: 38px;
    line-height: 1.45;
}
.alt-link-arrow {
    width: 100%;
    padding-left: 38px;
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--magenta);
}

/* --- Success --- */
.success-content {
    text-align: center;
    padding-top: 56px;
    position: relative;
    max-width: 340px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
#confettiCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 200;
}
.success-icon { font-size: 4rem; margin-bottom: 20px; animation: bounce 0.6s ease; }
@keyframes bounce {
    0%,100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-8px); }
}
.success-content h2 { font-size: clamp(1.6rem, 5vw, 2rem); margin-bottom: 12px; line-height: 1.2; }
.success-desc { font-size: 1rem; color: var(--gray-600); max-width: 220px; margin: 0 auto 20px; line-height: 1.5; }
.success-alt { font-size: 0.85rem; color: var(--gray-400); margin: 0 auto 12px; max-width: 220px; line-height: 1.4; }
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25D366;
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: 18px 24px;
    font-size: 1rem;
    width: 100%;
    text-decoration: none;
    transition: background 0.2s;
    margin-bottom: 12px;
}
.btn-whatsapp:hover { background: #1ebe5a; }

/* --- Bottom nav --- */
.wizard-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    height: var(--bottom-nav);
}
.wizard-nav.hidden { display: none; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    padding: 14px 24px;
    transition: all 0.25s ease;
}
.btn-primary {
    background: var(--magenta);
    color: var(--white);
    box-shadow: 0 2px 12px rgba(220, 61, 84, 0.25);
}
.btn-primary:hover:not(:disabled) {
    background: #c4324a;
    box-shadow: 0 4px 20px rgba(220, 61, 84, 0.35);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-next { flex: 1; max-width: 280px; margin-left: auto; }
.btn-back {
    color: var(--gray-600);
    padding: 14px 16px;
    font-size: 0.85rem;
}
.btn-back:hover { color: var(--gray-900); }
.btn-ghost {
    background: transparent;
    color: var(--gray-800);
    border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-full { width: 100%; }

/* --- Loading --- */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.loading-overlay p { font-weight: 600; color: var(--gray-600); }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--magenta);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Desktop enhancements --- */
@media (min-width: 640px) {
    .step-content { padding: 0 32px; }
    .chips-grid { grid-template-columns: repeat(3, 1fr); }
    .seg-btn { padding: 12px 8px; font-size: 0.8rem; }
    .alt-options { flex-direction: column; }
    .alt-card { text-align: left; }
    .alt-card p { text-align: left; }
}
