/* WSU Returns JSON Forms - Frontend Styles */

.wsu-returns-form-wrapper {
    max-width: 800px;
    margin: 20px auto;
    padding: 0;
}

.wsu-returns-json-form {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Form Header */
.form-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    padding: 30px;
    text-align: center;
}

.form-title {
    color: #333;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.form-description {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* Form Steps */
.form-steps {
    position: relative;
}

.wsu-returns-json-form .form-step {
    display: none !important;
    padding: 30px;
}

.wsu-returns-json-form .form-step.active {
    display: block !important;
}

.step-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e1e1;
}

.step-title {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.step-description {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* Form Fields */
.step-fields {
    margin-bottom: 30px;
}

.form-field {
    margin-bottom: 25px;
}

.field-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.field-label .required {
    color: #dc3545;
    margin-left: 4px;
}

.field-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.field-input {
    position: relative;
}

/* Input Controls */
.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #0073aa;
    outline: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 5px rgba(0, 115, 170, 0.5);
}

.form-control:invalid {
    border-color: #dc3545;
}

.form-control:invalid:focus {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 5px rgba(220, 53, 69, 0.5);
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
}

select.form-control[multiple] {
    background-image: none;
    padding-right: 15px;
    height: auto;
    min-height: 120px;
}

/* Non-returnable items styling */
select.form-control option.non-returnable {
    color: #999;
    font-style: italic;
}

select.form-control option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.5;
}

.form-checkbox {
    margin-right: 10px;
    margin-top: 3px;
    flex-shrink: 0;
}

.checkbox-text {
    flex: 1;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.step-navigation .button {
    min-width: 120px;
}

.step-prev-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
}

.step-prev-btn:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.step-next-btn {
    background: #0073aa;
    border: 1px solid #0073aa;
    color: #ffffff;
    margin-left: auto;
}

.step-next-btn:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Form Actions */
.form-actions {
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
    padding: 25px 30px;
    text-align: center;
}

.wsu-returns-submit-btn {
    background: #28a745;
    border: 1px solid #28a745;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    min-width: 150px;
}

.wsu-returns-submit-btn:hover {
    background: #218838;
    border-color: #218838;
}

.wsu-returns-submit-btn:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Form Messages */
.form-messages {
    padding: 20px 30px;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    padding: 15px;
    margin-bottom: 15px;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    padding: 15px;
    margin-bottom: 15px;
}

.wsu-returns-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

/* Field Validation */
.field-validation {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    line-height: 1.4;
}

.field-validation.show {
    display: block !important;
}

.form-field.has-error .form-control {
    border-color: #dc3545;
}

.form-field.has-error .field-label {
    color: #dc3545;
}

/* Loading State */
.wsu-returns-json-form.loading {
    position: relative;
    pointer-events: none;
}

.wsu-returns-json-form.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.wsu-returns-json-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wsu-returns-form-wrapper {
        margin: 10px;
    }

    .form-header {
        padding: 20px;
    }

    .form-title {
        font-size: 24px;
    }

    .form-step {
        padding: 20px;
    }

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

    .form-actions {
        padding: 20px;
    }

    .step-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .step-next-btn {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .form-header {
        padding: 15px;
    }

    .form-title {
        font-size: 20px;
    }

    .form-step {
        padding: 15px;
    }

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

    .form-actions {
        padding: 15px;
    }

    .wsu-returns-submit-btn {
        width: 100%;
        padding: 15px;
    }

    .step-navigation .button {
        width: 100%;
        min-width: auto;
    }
}