/* ========================================
   GROWVERN FORM WIZARD - IMMERSIVE UX
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a1430 0%, #1a1a4a 50%, #0a1430 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    color: #fff;
    overflow-x: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* Header - Compact for mobile */
.wizard-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 20, 48, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wizard-logo img {
    height: 32px;
    opacity: 0.9;
}

.wizard-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-wrapper {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f8d102 0%, #ffc107 100%);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    white-space: nowrap;
}

.progress-text span:first-child {
    color: #f8d102;
    font-weight: 600;
}

.wizard-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.wizard-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.wizard-close svg {
    width: 18px;
    height: 18px;
}

/* Main Container - Proper viewport handling */
.wizard-container {
    padding-top: 60px;
    padding-bottom: 100px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Steps */
.wizard-step {
    display: none;
    width: 100%;
    max-width: 600px;
    padding: 24px 20px 40px;
    animation: fadeIn 0.4s ease;
}

.wizard-step.active {
    display: block;
}

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

.step-content {
    width: 100%;
}

.step-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(248, 209, 2, 0.2) 0%, rgba(248, 209, 2, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.step-icon svg {
    width: 28px;
    height: 28px;
    color: #f8d102;
}

.step-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.step-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.form-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 16px; /* Prevents zoom on iOS */
    font-family: inherit;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #f8d102;
    background: rgba(255, 255, 255, 0.1);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    font-weight: 400;
}

.form-input.error, .form-textarea.error, .error {
    border-color: #ef4444 !important;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Select Cards - 2 columns on mobile */
.select-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.select-card {
    position: relative;
    cursor: pointer;
}

.select-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.select-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 70px;
}

.select-card:hover .card-content {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.select-card input:checked + .card-content {
    background: rgba(248, 209, 2, 0.15);
    border-color: #f8d102;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.card-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Package Cards - Compact */
.package-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.package-card {
    position: relative;
    cursor: pointer;
}

.package-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.package-content {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.package-card:hover .package-content {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.package-card input:checked + .package-content,
.package-card input:checked ~ .package-content {
    background: rgba(248, 209, 2, 0.1);
    border-color: #f8d102;
}

.package-card.popular .package-content {
    border-color: rgba(248, 209, 2, 0.3);
}

.popular-badge {
    position: absolute;
    top: -8px;
    left: 16px;
    background: linear-gradient(135deg, #f8d102 0%, #ffc107 100%);
    color: #0a1430;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 1;
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.package-name {
    font-size: 16px;
    font-weight: 700;
}

.package-leads {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.package-price {
    font-size: 22px;
    font-weight: 700;
    color: #f8d102;
    margin-bottom: 10px;
}

.package-price span {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
}

.package-details {
    list-style: none;
    padding: 0;
    margin: 0;
}

.package-details li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.package-details li:last-child {
    border-bottom: none;
}

.package-details svg {
    width: 14px;
    height: 14px;
    color: #22c55e;
    flex-shrink: 0;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.checkbox-card {
    position: relative;
    cursor: pointer;
}

.checkbox-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: center;
}

.checkbox-card:hover .checkbox-content {
    background: rgba(255, 255, 255, 0.08);
}

.checkbox-card input:checked + .checkbox-content {
    background: rgba(248, 209, 2, 0.15);
    border-color: #f8d102;
}

.checkbox-content svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.checkbox-card input:checked + .checkbox-content svg {
    color: #f8d102;
}

.checkbox-content span {
    font-size: 12px;
    font-weight: 500;
}

/* Radio Stack */
.radio-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    position: relative;
    cursor: pointer;
}

.radio-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-content {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.radio-option:hover .radio-content {
    background: rgba(255, 255, 255, 0.08);
}

.radio-option input:checked + .radio-content {
    background: rgba(248, 209, 2, 0.1);
    border-color: #f8d102;
}

.radio-title {
    font-size: 14px;
    font-weight: 500;
}

/* Privacy Consent */
.privacy-consent {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.consent-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #f8d102;
    margin-top: 2px;
    flex-shrink: 0;
}

.consent-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.consent-text a {
    color: #f8d102;
    text-decoration: underline;
}

/* Final Note */
.final-note {
    margin-top: 20px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 3px solid #f8d102;
}

.final-note p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin: 0;
}

/* Navigation - Fixed bottom, larger touch targets */
.wizard-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(10, 20, 48, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

.btn-prev {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 16px 24px;
}

.btn-prev:hover, .btn-prev:active {
    background: rgba(255, 255, 255, 0.15);
}

.btn-next, .btn-submit {
    background: linear-gradient(135deg, #f8d102 0%, #ffc107 100%);
    color: #0a1430;
    flex: 1;
    max-width: 200px;
}

.btn-next:hover, .btn-next:active,
.btn-submit:hover, .btn-submit:active {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(248, 209, 2, 0.3);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

#submitBtn {
    display: none;
}

#prevBtn {
    display: none;
}

/* Keyboard Hint - Hidden on mobile */
.keyboard-hint {
    display: none;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Larger phones and up */
@media (min-width: 400px) {
    .select-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets and up */
@media (min-width: 768px) {
    .wizard-header {
        height: 70px;
        padding: 0 24px;
    }

    .wizard-logo img {
        height: 40px;
    }

    .progress-bar-wrapper {
        width: 180px;
        height: 6px;
    }

    .wizard-close {
        width: 40px;
        height: 40px;
    }

    .wizard-container {
        padding-top: 70px;
        padding-bottom: 100px;
        align-items: center;
    }

    .wizard-step {
        padding: 40px 24px 60px;
    }

    .step-icon {
        width: 72px;
        height: 72px;
        margin-bottom: 28px;
    }

    .step-icon svg {
        width: 32px;
        height: 32px;
    }

    .step-title {
        font-size: 32px;
    }

    .step-subtitle {
        font-size: 17px;
        margin-bottom: 36px;
    }

    .form-group {
        margin-bottom: 24px;
    }

    .form-label {
        font-size: 15px;
    }

    .form-input, .form-textarea {
        padding: 16px 20px;
    }

    .select-cards {
        gap: 12px;
    }

    .select-card .card-content {
        padding: 20px 16px;
        min-height: 80px;
    }

    .card-title {
        font-size: 17px;
    }

    .card-desc {
        font-size: 12px;
    }

    .package-content {
        padding: 20px;
    }

    .package-name {
        font-size: 18px;
    }

    .package-price {
        font-size: 26px;
    }

    .package-details li {
        font-size: 13px;
    }

    .checkbox-content {
        padding: 18px 14px;
    }

    .checkbox-content svg {
        width: 24px;
        height: 24px;
    }

    .checkbox-content span {
        font-size: 13px;
    }

    .radio-content {
        padding: 16px 20px;
    }

    .radio-title {
        font-size: 15px;
    }

    .wizard-nav {
        height: 90px;
        gap: 16px;
    }

    .nav-btn {
        padding: 16px 36px;
        font-size: 16px;
    }

    .btn-next, .btn-submit {
        max-width: 240px;
    }

    .keyboard-hint {
        display: flex;
        position: fixed;
        bottom: 110px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 13px;
        color: rgba(255, 255, 255, 0.4);
        align-items: center;
        gap: 6px;
    }

    .keyboard-hint kbd {
        background: rgba(255, 255, 255, 0.1);
        padding: 3px 8px;
        border-radius: 4px;
        font-family: inherit;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .wizard-step {
        max-width: 700px;
    }

    .checkbox-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Handle iOS safe areas */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .wizard-nav {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .wizard-container {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}
