/* Onboarding Form Styles */

/* Modal Overlay */
.onboarding-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.onboarding-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Container */
.onboarding-modal {
    background: white;
    border-radius: 24px;
    padding: 48px;
    max-width: 600px;
    width: 100%;
    height: 85vh; /* Fixed height that adapts to screen size */
    max-height: 700px; /* Maximum height on large screens */
    min-height: 500px; /* Minimum height on small screens */
    overflow: hidden; /* Hide overflow on container */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Modal Content Wrapper - scrollable area */
.modal-content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 -8px; /* Offset padding for scrollbar */
    padding: 0 8px;
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(23, 23, 25, 0.5);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #171719;
}

/* Progress Bar - Fixed at top */
.progress-container {
    margin-bottom: 16px; /* Reduced from 32px */
    flex-shrink: 0; /* Don't shrink when content is large */
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.progress-fill {
    height: 100%;
    background: #171719;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: rgba(23, 23, 25, 0.6);
    margin-top: 8px;
    margin-bottom: 8px; /* Reduced spacing before question */
    text-align: center;
    flex-shrink: 0;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

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

.form-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #171719;
    margin-bottom: 12px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'EB Garamond', serif;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #171719;
}

.form-input.error {
    border-color: #ef4444;
}

/* Select Dropdowns */
.form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'EB Garamond', serif;
    transition: border-color 0.2s;
    background: white;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23171719' d='M1.41 0L6 4.59L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #171719;
}

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

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.radio-option:hover {
    border-color: #171719;
    background: #f9f9f9;
}

.radio-option.selected {
    border-color: #171719;
    background: #f9f9f9;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

.radio-label {
    font-size: 16px;
    font-weight: 500;
    color: #171719;
}

/* Checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-option {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.checkbox-option:hover {
    border-color: #171719;
    background: #f9f9f9;
}

.checkbox-option.selected {
    border-color: #171719;
    background: #f9f9f9;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

.checkbox-label {
    font-size: 16px;
    font-weight: 500;
    color: #171719;
}

/* Buttons */
.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-back {
    flex: 1;
    padding: 16px;
    background: white;
    color: #171719;
    border: 2px solid #171719;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #f9f9f9;
}

.btn-next {
    flex: 2;
    padding: 16px;
    background: #171719;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-next:hover {
    background: #2a2a2c;
    transform: translateY(-2px);
}

.btn-next:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Helper Text */
.helper-text {
    font-size: 16px;
    color: rgba(23, 23, 25, 0.6);
    margin-top: 8px;
}

/* Case Study Agreement */
.agreement-box {
    background: #fef3c7;
    border: 2px solid #d97706;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.agreement-box h3 {
    font-size: 20px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 12px;
}

.agreement-box ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.agreement-box li {
    font-size: 16px;
    color: #92400e;
    margin-bottom: 8px;
}

.agreement-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
}

.agreement-checkbox input[type="checkbox"] {
    margin-top: 4px;
    width: 20px;
    height: 20px;
}

.agreement-checkbox label {
    font-size: 16px;
    font-weight: 500;
    color: #171719;
}

/* iOS-Style Picker Sheet */
.picker-sheet-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000; /* Above modal */
    align-items: flex-end;
    justify-content: center;
}

.picker-sheet-overlay.active {
    display: flex;
}

.picker-sheet {
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.picker-sheet h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.picker-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.picker-option {
    padding: 16px;
    background: #f4f1fc;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    text-align: left;
}

.picker-option:hover {
    background: #e8e3f7;
}

.picker-option.selected {
    background: #171719;
    color: white;
    border-color: #171719;
}

.picker-done-btn {
    width: 100%;
    padding: 16px;
    background: #171719;
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.picker-done-btn:hover {
    opacity: 0.9;
}

.picker-done-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Picker Button (looks like input) */
.picker-button {
    width: 100%;
    padding: 16px;
    background: #f4f1fc;
    border: 1px solid rgba(23, 23, 25, 0.1);
    border-radius: 12px;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.picker-button:hover {
    background: #e8e3f7;
}

.picker-button.placeholder {
    color: #999;
}

.picker-button::after {
    content: '▼';
    font-size: 12px;
    color: rgba(23, 23, 25, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .onboarding-overlay {
        padding: 10px;
    }

    .onboarding-modal {
        padding: 24px 20px;
        height: 90vh; /* Fixed height on tablet */
        max-height: 650px;
        min-height: 450px;
        border-radius: 16px;
    }

    .modal-header h2 {
        font-size: 24px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .form-buttons {
        flex-direction: column;
    }

    .btn-back, .btn-next {
        width: 100%;
    }

    .form-step h3 {
        font-size: 20px;
    }

    .form-step p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .onboarding-modal {
        padding: 20px 16px;
        height: 95vh; /* Fixed height on mobile */
        max-height: none; /* Remove max-height on small screens */
        min-height: 400px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .progress-bar {
        height: 4px;
    }

    .form-step h3 {
        font-size: 18px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    select {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px; /* Touch-friendly */
    }

    button {
        min-height: 44px; /* Touch-friendly */
    }
}

