/**
 * Onboarding Form Styles
 * 
 * BEM methodology used for class naming
 * Responsive design for all devices
 */

/* Onboarding Container */
.onboarding-container {
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* Form Wrapper */
.onboarding-form-wrapper {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .onboarding-form-wrapper {
        padding: 20px;
    }
}

/* Progress Bar */
.onboarding-progress {
    margin-bottom: 40px;
}

.progress-bar {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #FF8473, #FFE588);
    width: 0;
    transition: width 0.5s ease;
    border-radius: 3px;
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.step-indicators::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e9ecef;
    z-index: 1;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c757d;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active {
    border-color: linear-gradient(45deg, #FF8473, #FFE588);
    color: linear-gradient(45deg, #FF8473, #FFE588);
    box-shadow: 0 0 0 5px rgba(255, 132, 115, 0.1);
}

.step.completed {
    background-image: linear-gradient(45deg, #FF8473, #FFE588);
    color: #fff;
}

/* Form Steps */
.form-step {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

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

/* Animation Classes */
.slide-in-right {
    animation: slideInRight 0.5s forwards;
}

.slide-out-left {
    animation: slideOutLeft 0.5s forwards;
}

.slide-in-left {
    animation: slideInLeft 0.5s forwards;
}

.slide-out-right {
    animation: slideOutRight 0.5s forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50px);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(50px);
        opacity: 0;
    }
}

/* Form Groups */
.form-group {
    margin-bottom: 30px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #495057;
    font-size: 15px;
    transition: all 0.3s ease;
    text-align: right;
}

.mil-form-input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    color: #495057;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    text-align: right;
    direction: rtl;
}

.mil-form-input:focus {
    border-image: linear-gradient(45deg, #FF8473, #FFE588) 1;
    box-shadow: 0 0 0 4px rgba(255, 132, 115, 0.15);
    outline: none;
    background-color: #fff;
    animation: inputFocus 1s ease-in-out;
}

.mil-form-input::placeholder {
    color: #adb5bd;
    opacity: 0.7;
    text-align: right;
    direction: rtl;
}

.mil-form-input.error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

/* Style for select dropdowns */
select.mil-form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23495057' 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: left 15px center;
    padding-left: 40px;
    padding-right: 18px;
}

/* Style for textareas */
textarea.mil-form-input {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Floating label effect */
.form-group.floating {
    position: relative;
}

.form-group.floating label {
    position: absolute;
    top: 8px;
    right: 10px;
    margin: 0;
    padding: 0 5px;
    background-color: transparent;
    transition: all 0.2s ease;
    pointer-events: none;
    color: #adb5bd;
    z-index: 1;
}

.form-group.floating .mil-form-input:focus + label,
.form-group.floating .mil-form-input:not(:placeholder-shown) + label {
    top: -20px;
    right: 10px;
    font-size: 12px;
    background-color: #ffffff96;
    background: linear-gradient(45deg, #FF8473, #FFE588);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}

/* Input with icons */
.input-with-icon {
    position: relative;
}

.input-with-icon .mil-form-input {
    padding-left: 45px;
    padding-right: 18px;
}

.input-with-icon .input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #adb5bd;
    transition: all 0.3s ease;
    z-index: 1;
}

.input-with-icon .mil-form-input:focus ~ .input-icon {
    color: #FF8473;
}

/* Make the input-with-icon class work with floating labels */
.form-group.floating.input-with-icon label {
    z-index: 2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 20px;
    }
    
    .mil-form-input {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .form-group.floating label {
        top: 8px;
        right: 10px;
        font-size: 14px;
    }
    
    .form-group.floating .mil-form-input:focus + label,
    .form-group.floating .mil-form-input:not(:placeholder-shown) + label {
        top: -15px;
        right: 8px;
        font-size: 11px;
    }
    
    .input-with-icon .input-icon {
        left: 12px;
        font-size: 14px;
    }
    
    .input-with-icon .mil-form-input {
        padding-left: 35px;
        padding-right: 15px;
    }
    
    textarea.mil-form-input {
        min-height: 100px;
    }
}

@media (max-width: 576px) {
    .form-group {
        margin-bottom: 15px;
    }
    
    .mil-form-input {
        padding: 10px 12px;
        font-size: 14px;
        border-width: 1px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group.floating label {
        top: 8px;
        right: 10px;
        font-size: 13px;
    }
    
    .form-group.floating .mil-form-input:focus + label,
    .form-group.floating .mil-form-input:not(:placeholder-shown) + label {
        top: -15px;
        right: 7px;
        font-size: 10px;
        padding: 0 3px;
    }
    
    .input-with-icon .input-icon {
        left: 10px;
        font-size: 13px;
    }
    
    .input-with-icon .mil-form-input {
        padding-left: 30px;
        padding-right: 12px;
    }
    
    textarea.mil-form-input {
        min-height: 80px;
    }
    
    select.mil-form-input {
        background-position: left 10px center;
        padding-left: 30px;
    }
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio: 0) { 
    select,
    textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"] {
        font-size: 16px !important;
    }
}

/* Fix for floating labels on Safari */
@supports (-webkit-touch-callout: none) {
    .form-group.floating .mil-form-input:not(:placeholder-shown) + label {
        top: -20px;
        right: 10px;
        font-size: 12px;
        background-color: #ffffff96;
        color: transparent;
        font-weight: 600;
        background-image: linear-gradient(45deg, #FF8473, #FFE588);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

/* Service Options */
.service-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .service-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .service-options {
        grid-template-columns: 1fr;
    }
}

.service-option {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-option:hover {
    border-image: linear-gradient(45deg, #FF8473, #FFE588) 1;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(74, 107, 255, 0.1);
}

.service-option.active {
    border-image: linear-gradient(45deg, #FF8473, #FFE588) 1;
    background-color: rgba(74, 107, 255, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(74, 107, 255, 0.1);
}

.service-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.service-icon {
    font-size: 32px;
    background-image: linear-gradient(45deg, #FF8473, #FFE588);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.service-option:hover .service-icon,
.service-option.active .service-icon {
    transform: scale(1.2);
}

.service-option h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    align-items: center;
}

/* First step navigation (only next button) should be centered */
.form-step[data-step="1"] .form-navigation {
    justify-content: center;
}

/* For larger screens, center the button on the first step */
@media (min-width: 768px) {
    .form-step[data-step="1"] .form-navigation .next-step {
        min-width: 180px;
    }
}

/* For mobile screens */
@media (max-width: 767px) {
    .form-navigation {
        flex-direction: column-reverse;
        gap: 15px;
    }
    
    .form-navigation button {
        width: 100%;
    }
}

.form-navigation button {
    min-width: 120px;
    background-image: linear-gradient(45deg, #FF8473, #FFE588);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 12px 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 107, 115, 0.2);
}

.form-navigation button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 107, 115, 0.3);
}

.form-navigation button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(255, 107, 115, 0.2);
}

.form-navigation button.prev-step {
    background-image: none;
    background-color: #fff;
    color: transparent;
    background-image: linear-gradient(45deg, #FF8473, #FFE588);
    background-clip: text;
    -webkit-background-clip: text;
    border: 2px solid transparent;
    border-image: linear-gradient(45deg, #FF8473, #FFE588) 1;
}

.form-navigation button.submit-form {
    background-image: linear-gradient(45deg, #FF8473, #FFE588);
    font-weight: 700;
}

/* Disabled button state during transitions */
.form-navigation button.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media (max-width: 576px) {
    .form-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-navigation button {
        width: 100%;
    }
}

/* Error Message */
.form-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Success Message */
.submission-success {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.success-icon {
    font-size: 60px;
    color: transparent;
    background-image: linear-gradient(45deg, #FF8473, #FFE588);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* RTL Support */
[dir="rtl"] .slide-in-right {
    animation: slideInLeft 0.5s forwards;
}

[dir="rtl"] .slide-out-left {
    animation: slideOutRight 0.5s forwards;
}

[dir="rtl"] .slide-in-left {
    animation: slideInRight 0.5s forwards;
}

[dir="rtl"] .slide-out-right {
    animation: slideOutLeft 0.5s forwards;
}

/* Focus animation */
@keyframes inputFocus {
    0% { box-shadow: 0 0 0 0 rgba(255, 132, 115, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 132, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 132, 115, 0); }
}
