/* Frontend Styles for Multi Step Form Creator */

/* Form Wrapper */
.msfc-form-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Form Container */
.msfc-form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.msfc-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.msfc-form-header h3 {
    margin: 0 0 15px 0;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
}

.form-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

/* Completion Bar */
.msfc-completion-bar {
    position: relative;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

.msfc-completion-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa 0%, #0056b3 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.msfc-completion-text {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Step Progress - Horizontal Layout */
.msfc-step-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
    position: relative;
    gap: 0;
}

.msfc-progress-track {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 20px;
    flex: 1;
    transition: all 0.3s ease;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.step-indicator.active .step-number {
    background: linear-gradient(135deg, #0073aa 0%, #0056b3 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.step-indicator.completed .step-number {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.step-indicator.completed .step-number::after {
    content: '✓';
    position: absolute;
}

.step-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-indicator.active .step-label {
    color: #0073aa;
    font-weight: 700;
}

.step-indicator.completed .step-label {
    color: #28a745;
}

.step-status {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-transform: capitalize;
}

/* Step Progress - Vertical Layout */
.msfc-step-progress.msfc-layout-vertical {
    flex-direction: column;
    gap: 20px;
}

.msfc-step-progress.msfc-layout-vertical .msfc-progress-track {
    top: 0;
    left: 24px;
    right: auto;
    width: 3px;
    height: 100%;
}

.msfc-step-progress.msfc-layout-vertical .step-indicator {
    flex-direction: row;
    text-align: left;
    gap: 15px;
    padding: 0;
    margin-bottom: 0;
}

.msfc-step-progress.msfc-layout-vertical .step-number {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.msfc-step-progress.msfc-layout-vertical .step-label {
    font-size: 14px;
}

/* Form Steps */
.msfc-form {
    position: relative;
}

.msfc-step {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.msfc-step.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
    animation: fadeInStep 0.4s ease forwards;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msfc-form[data-animation="slide"] .msfc-step.active {
    animation: slideInStep 0.4s ease forwards;
}

@keyframes slideInStep {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.msfc-step-content {
    padding: 0;
}

.msfc-step-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
}

.msfc-step-header h4 {
    margin: 0;
    color: #1a1a1a;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
}

.step-title-number {
    color: #0073aa;
}

.step-title-divider {
    color: #ddd;
    font-size: 18px;
}

.step-title-total {
    color: #999;
    font-size: 18px;
    font-weight: 600;
}

.msfc-fields-wrapper {
    margin-bottom: 30px;
}

/* Field Styling */
.msfc-field-wrapper {
    margin-bottom: 30px;
}

.msfc-field-wrapper:last-child {
    margin-bottom: 0;
}

.msfc-field-wrapper label {
    display: block;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-size: 15px;
    letter-spacing: -0.3px;
}

.required {
    color: #d63638;
    font-weight: 700;
}

.msfc-field-wrapper input[type="text"],
.msfc-field-wrapper input[type="email"],
.msfc-field-wrapper input[type="number"],
.msfc-field-wrapper input[type="tel"],
.msfc-field-wrapper input[type="date"],
.msfc-field-wrapper textarea,
.msfc-field-wrapper select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
    color: #333;
    box-sizing: border-box;
}

.msfc-field-wrapper input::placeholder,
.msfc-field-wrapper textarea::placeholder {
    color: #999;
}

.msfc-field-wrapper input:focus,
.msfc-field-wrapper textarea:focus,
.msfc-field-wrapper select:focus {
    outline: none;
    border-color: #0073aa;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.1);
    color: #1a1a1a;
}

.msfc-field-wrapper input:disabled,
.msfc-field-wrapper textarea:disabled,
.msfc-field-wrapper select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.msfc-field-wrapper textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* ZIP Code Field */
.zip-field-container {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.zip-field-container input {
    flex: 1;
}

.auto-detect-zip {
    background: linear-gradient(135deg, #0073aa 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-detect-zip:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.auto-detect-zip:active:not(:disabled) {
    transform: translateY(0);
}

.auto-detect-zip:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Checkbox and Radio Options */
.checkbox-option,
.radio-option {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-option:hover,
.radio-option:hover {
    background: #f0f1f3;
    border-color: #0073aa;
}

.checkbox-option input,
.radio-option input {
    margin: 0 12px 0 0;
    transform: scale(1.3);
    cursor: pointer;
    accent-color: #0073aa;
}

.checkbox-option label,
.radio-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

/* Field Description */
.field-description {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
}

/* Step Navigation */
.msfc-step-navigation {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    gap: 20px;
}

.msfc-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.msfc-nav-spacer {
    flex: 1;
}

.msfc-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 140px;
}

.msfc-btn .btn-text {
    display: inline-block;
}

.msfc-btn-primary {
    background: linear-gradient(135deg, #0073aa 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
}

.msfc-btn-primary:hover {
    background: linear-gradient(135deg, #005a87 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.3);
}

.msfc-btn-primary:active {
    transform: translateY(0);
}

.msfc-btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.15);
}

.msfc-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.25);
}

.msfc-btn-secondary:active {
    transform: translateY(0);
}

.msfc-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    min-width: 180px;
}

.msfc-btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}

.msfc-btn-success:active {
    transform: translateY(0);
}

.msfc-step-counter {
    text-align: center;
    font-size: 13px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Messages */
.msfc-messages-container {
    margin-top: 20px;
    min-height: 0;
}

.msfc-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msfc-message.success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.msfc-message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #d63638;
}

.msfc-message.warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.msfc-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #0073aa;
}

.msfc-error {
    background: #f8d7da;
    color: #721c24;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #d63638;
}

/* Loading State */
.msfc-form.loading {
    opacity: 0.5;
    pointer-events: none;
}

.msfc-form.loading .msfc-btn {
    opacity: 0.5;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Validation Errors */
.msfc-field-wrapper.error input,
.msfc-field-wrapper.error textarea,
.msfc-field-wrapper.error select {
    border-color: #d63638;
    background-color: #fdf8f8;
}

.msfc-field-wrapper .error-message {
    color: #d63638;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.msfc-field-wrapper .error-message::before {
    content: '⚠';
}

/* Responsive Design - Tablets */
@media (max-width: 768px) {
    .msfc-form-container {
        padding: 25px;
        margin: 15px;
    }
    
    .msfc-form-header h3 {
        font-size: 24px;
    }
    
    .msfc-step-progress {
        margin-bottom: 35px;
    }
    
    .step-indicator {
        padding: 0 15px;
    }
    
    .step-number {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    .msfc-step-header h4 {
        font-size: 20px;
    }
    
    .zip-field-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .msfc-step-navigation {
        margin-top: 35px;
        padding-top: 25px;
    }
    
    .msfc-nav-buttons {
        flex-wrap: wrap;
    }
    
    .msfc-btn {
        flex: 1;
        min-width: 120px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .msfc-step-counter {
        width: 100%;
        order: 3;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .msfc-form-container {
        padding: 18px;
        border-radius: 8px;
    }
    
    .msfc-form-header {
        margin-bottom: 25px;
    }
    
    .msfc-form-header h3 {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .form-description {
        font-size: 14px;
    }
    
    .msfc-completion-bar {
        height: 6px;
        margin-top: 15px;
    }
    
    .msfc-step-progress {
        margin-bottom: 25px;
        gap: 5px;
    }
    
    .msfc-progress-track {
        height: 2px;
    }
    
    .step-indicator {
        padding: 0 8px;
    }
    
    .step-number {
        width: 38px;
        height: 38px;
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .msfc-step-header h4 {
        font-size: 18px;
        gap: 6px;
    }
    
    .step-title-divider {
        font-size: 14px;
    }
    
    .step-title-total {
        font-size: 14px;
    }
    
    .msfc-field-wrapper label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .msfc-field-wrapper input,
    .msfc-field-wrapper textarea,
    .msfc-field-wrapper select {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
    }
    
    .msfc-field-wrapper textarea {
        min-height: 100px;
    }
    
    .zip-field-container {
        gap: 10px;
    }
    
    .auto-detect-zip {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .checkbox-option,
    .radio-option {
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    
    .msfc-field-wrapper input[type="checkbox"],
    .msfc-field-wrapper input[type="radio"] {
        transform: scale(1.2);
    }
    
    .msfc-step-navigation {
        margin-top: 30px;
        padding-top: 20px;
        gap: 12px;
    }
    
    .msfc-nav-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .msfc-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 13px;
        min-width: auto;
    }
    
    .msfc-step-counter {
        font-size: 12px;
        margin-top: 10px;
    }
}