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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;
    background: #F5F7FA;
    min-height: 100vh;
}

.page-container {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
}

.form-container {
    background: white;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

/* Progress Bar - Exact match to screenshot */
.progress-wrapper {
    position: relative;
    height: 40px;
    background: #D4D8DD;
    width: 100%;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.progress-fill {
    height: 100%;
    background: #1FAA8A;
    transition: width 0.4s ease;
}

.progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2C3E50;
    font-weight: 600;
    font-size: 14px;
    z-index: 2;
}

/* Navigation Buttons */
.back-button {
    position: absolute;
    left: 20px;
    top: 60px;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9CA3AF;
    transition: all 0.2s ease;
    z-index: 10;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.back-button:hover {
    background: #F3F4F6;
    color: #6B7280;
}

.close-button {
    position: absolute;
    right: 20px;
    top: 60px;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9CA3AF;
    transition: all 0.2s ease;
    z-index: 10;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-button:hover {
    background: #F3F4F6;
    color: #6B7280;
}

/* Form Content */
.form-content {
    padding: 80px 60px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1E3A5F;
    text-align: center;
    margin-bottom: 50px;
    line-height: 1.4;
}

/* Dynamic Form */
.dynamic-form {
    width: 100%;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 0;
    width: 100%;
}

.form-group.inline-fields {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

/* Form fields grid layout */
.form-fields {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 10px;
}

/* Column width classes */
[class*="col-"] {
    margin-bottom: 5px; /* Space between form fields */
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

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

.form-control {
    width: 100%;
    padding: 16px 18px;
    font-size: 16px;
    border: 2px solid #D1D5DB;
    border-radius: 4px;
    transition: all 0.2s ease;
    background-color: white;
    color: #374151;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #9CA3AF;
    background-color: white;
}

.form-control::placeholder {
    color: #9CA3AF;
}

/* Select Dropdown - Match screenshot */
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
    padding-right: 45px;
    color: #6B7280;
}

/* Radio Group - Exact match to screenshot */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Space between radio options */
    margin-top: 8px; /* Space between label and first radio button */
}

.radio-button {
    display: block;
    position: relative;
}

.radio-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: block;
    padding: 18px 24px;
    background: #F3F4F6;
    color: #374151;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 16px;
    text-align: center;
}

.radio-button input[type="radio"]:checked + .radio-label {
    background: #3B82F6;
    color: white;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.radio-button:hover .radio-label {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.radio-button input[type="radio"]:checked:hover + .radio-label {
    background: #2563EB;
    color: white;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-top: 8px; /* Space between label and checkbox */
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    margin-top: 2px;
}

.checkbox-label {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.5;
    cursor: pointer;
}

/* Text Content */
.text-content {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    padding: 16px 0;
}

/* Error State - Match screenshot */
.form-group.has-error .form-control {
    border-color: #EF4444;
}

.error-message {
    display: block;
    color: #DC2626;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 60px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #FF7961;
    color: white;
    min-width: 380px;
}

.btn-next:hover {
    background: #FF6B5A;
}

.btn-next:active {
    transform: translateY(1px);
}

.btn-next svg {
    transition: transform 0.2s ease;
}

.btn-next:hover svg {
    transform: translateX(3px);
}

/* Success Page */
.success-message {
    text-align: center;
    padding: 80px 30px;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: #1FAA8A;
    color: white;
    border-radius: 50%;
    font-size: 52px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(31, 170, 138, 0.3);
}

.success-message h1 {
    color: #1E3A5F;
    margin-bottom: 20px;
    font-size: 36px;
    font-weight: 700;
}

.success-message p {
    color: #6B7280;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.submission-details {
    padding: 40px;
    background: #F9FAFB;
    margin: 40px auto;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    max-width: 600px;
}

.submission-details h2 {
    font-size: 22px;
    color: #1E3A5F;
    margin-bottom: 24px;
    font-weight: 700;
}

.submission-details dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
}

.submission-details dt {
    font-weight: 600;
    color: #374151;
}

.submission-details dd {
    color: #6B7280;
}

/* Responsive */
@media (max-width: 768px) {
    .form-content {
        padding: 60px 24px 40px;
    }

    .form-title {
        font-size: 22px;
        margin-bottom: 35px;
    }

    .back-button {
        left: 12px;
        top: 54px;
        width: 40px;
        height: 40px;
    }

    .close-button {
        right: 12px;
        top: 54px;
        width: 40px;
        height: 40px;
    }

    .form-group.inline-fields,
    .form-fields {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        grid-column: span 12; /* Full width on mobile */
    }

    .btn-next {
        width: 100%;
        min-width: unset;
        padding: 16px 40px;
        font-size: 16px;
    }

    .submission-details {
        margin: 30px 20px;
        padding: 30px 24px;
    }

    .submission-details dl {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .submission-details dt {
        margin-top: 8px;
        font-size: 14px;
    }

    .submission-details dd {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .form-title {
        font-size: 20px;
    }

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

    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .radio-label {
        font-size: 15px;
        padding: 16px 20px;
    }
}

/* Form Footer Text */
.form-footer-text {
    margin-top: 16px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.form-footer-text a {
    color: #FF6B5A;
    text-decoration: none;
    font-weight: 500;
}

.form-footer-text a:hover {
    text-decoration: underline;
}

.form-footer-text p {
    margin: 0 0 8px 0;
}

.form-footer-text p:last-child {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .form-footer-text {
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Range Slider */
.range-wrapper {
    width: 100%;
}

.form-range {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3B82F6;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.form-range::-webkit-slider-thumb:hover {
    background: #2563EB;
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3B82F6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.form-range::-moz-range-thumb:hover {
    background: #2563EB;
}

.range-value {
    text-align: center;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #1E3A5F;
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #D1D5DB;
    border-radius: 13px;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-label .toggle-switch {
    background: #3B82F6;
}

.toggle-input:checked + .toggle-label .toggle-switch::after {
    transform: translateX(24px);
}

.toggle-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    min-width: 40px;
}

/* Multiselect */
select[multiple].form-select {
    height: auto;
    min-height: 120px;
    padding: 8px;
    background-image: none; /* Remove dropdown arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select[multiple].form-select option {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 4px;
}

select[multiple].form-select option:checked {
    background: #3B82F6;
    color: white;
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6B7280;
}

.text-muted {
    color: #9CA3AF !important;
}

/* Captcha */
.captcha-wrapper {
    margin-top: 8px;
}

.g-recaptcha {
    transform: scale(0.9);
    transform-origin: 0 0;
}

@media (max-width: 480px) {
    .g-recaptcha {
        transform: scale(0.8);
    }
    
    .range-value {
        font-size: 16px;
    }
    
    .toggle-switch {
        width: 44px;
        height: 24px;
    }
    
    .toggle-switch::after {
        width: 18px;
        height: 18px;
    }
    
    .toggle-input:checked + .toggle-label .toggle-switch::after {
        transform: translateX(20px);
    }
}

/* Star Rating */
.star-rating-wrapper {
    width: 100%;
}

.star-rating {
    display: inline-flex;
    gap: 8px;
    font-size: 36px;
    cursor: pointer;
    user-select: none;
}

.star-rating .star {
    color: #D1D5DB;
    transition: color 0.2s ease, transform 0.1s ease;
    display: inline-block;
}

.star-rating .star:hover {
    transform: scale(1.1);
}

.star-rating .star.active {
    color: #F59E0B;
}

.star-rating .star.hover {
    color: #FBBF24;
}

@media (max-width: 480px) {
    .star-rating {
        font-size: 28px;
        gap: 4px;
    }
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-picker {
    width: 60px;
    height: 40px;
    padding: 4px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.color-picker::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

.color-text {
    flex: 1;
    max-width: 120px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.color-preview {
    width: 40px;
    height: 40px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

@media (max-width: 480px) {
    .color-picker-wrapper {
        gap: 8px;
    }
    
    .color-picker {
        width: 50px;
        height: 36px;
    }
    
    .color-text {
        max-width: 100px;
        font-size: 14px;
    }
    
    .color-preview {
        width: 36px;
        height: 36px;
    }
}


/* ==============================================
   Star Rating Styles
   ============================================== */
.star-rating-wrapper {
    margin: 10px 0;
}

.star-rating {
    display: inline-flex;
    gap: 8px;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
}

.star-rating .star {
    color: #D1D5DB;
    transition: all 0.2s ease;
    position: relative;
}

.star-rating .star:hover,
.star-rating .star.hover {
    color: #FBBF24;
    transform: scale(1.1);
}

.star-rating .star.active {
    color: #F59E0B;
}

.star-rating .star.active:hover,
.star-rating .star.active.hover {
    color: #D97706;
}

@media (max-width: 768px) {
    .star-rating {
        font-size: 32px;
        gap: 4px;
    }
}

/* ==============================================
   Color Picker Styles
   ============================================== */
.color-picker-wrapper {
    margin: 10px 0;
}

.color-picker-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-picker {
    width: 60px;
    height: 45px;
    border: 2px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    transition: border-color 0.2s;
}

.color-picker:hover {
    border-color: #3B82F6;
}

.color-picker:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.color-hex {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    text-transform: uppercase;
}

.color-hex:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* Spinner for loading state */
.spinner-border-sm {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Disabled button state */
button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}


@media (max-width: 768px) {
    .color-picker {
        width: 50px;
        height: 40px;
    }
}


@media (min-width: 768px) {
    .form-actions {
        justify-content: space-between;
        flex-direction: row;
    }

    .btn-previous, .btn-secondary {
        order: 1;
    }

    .btn-next,
    .btn-submit,
    .btn-primary {
        order: 2;
    }
}

@media (max-width: 767px) {
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-next,
    .btn-submit,
    .btn-primary {
        order: 1;
        width: 100%;
    }

    .btn-previous, .btn-secondary {
        order: 2;
        width: 100%;
    }
}