/**
 * Light Multi-Step Form - Frontend & Shared Styles
 */

:root {
    --lmf-primary: #BB3421;
    --lmf-bg: #ffffff;
    --lmf-text: #1e293b;
    --lmf-text-muted: #64748b;
    --lmf-border: #cbd5e1;
    --lmf-border-focus: #BB3421;
    --lmf-radius: 8px;
    --lmf-error: #ef4444;
    --lmf-success: #10b981;
}

.lmf-form-wrapper {
    width: 100%;
    max-width: 680px;
    margin: 30px auto;
    background: var(--lmf-bg);
    border: 1px solid var(--lmf-border);
    border-radius: var(--lmf-radius);
    padding: 32px 28px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    font-family: inherit;
    color: var(--lmf-text);
}

.lmf-form-title {
    margin: 0 0 24px 0;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: var(--lmf-text);
}

/* Steps Progress Header */
.lmf-steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 32px;
}

.lmf-steps-header::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.lmf-progress-line {
    position: absolute;
    top: 18px;
    left: 20px;
    height: 3px;
    background: var(--lmf-primary);
    z-index: 2;
    transition: width 0.3s ease;
}

.lmf-step-indicator {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.lmf-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: var(--lmf-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
}

.lmf-step-indicator.active .lmf-step-circle {
    border-color: var(--lmf-primary);
    background: var(--lmf-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.lmf-step-indicator.completed .lmf-step-circle {
    border-color: var(--lmf-primary);
    background: var(--lmf-primary);
    color: #ffffff;
}

.lmf-step-name {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--lmf-text-muted);
    text-align: center;
}

.lmf-step-indicator.active .lmf-step-name {
    color: var(--lmf-primary);
    font-weight: 600;
}

/* Steps Content */
.lmf-step {
    display: none;
    animation: lmfFadeIn 0.3s ease;
}

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

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

.lmf-step-description {
    font-size: 14px;
    color: var(--lmf-text-muted);
    margin-bottom: 20px;
}

.lmf-step-fields {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
}

/* Fields */
.lmf-field-group {
    flex: 0 0 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

.lmf-field-group.lmf-width-50 {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
    margin-left: 0;
    margin-right: 0;
}

.lmf-field-group.lmf-width-33 {
    flex: 0 0 calc(33.333% - 11px);
    max-width: calc(33.333% - 11px);
    margin-left: 0;
    margin-right: 0;
}

@media (max-width: 600px) {
    .lmf-field-group.lmf-width-50,
    .lmf-field-group.lmf-width-33 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.lmf-field-label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--lmf-text);
}

.lmf-required-star {
    color: var(--lmf-error);
}

.lmf-input,
.lmf-select,
.lmf-textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1.5px solid var(--lmf-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--lmf-text);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
}

.lmf-input:focus,
.lmf-select:focus,
.lmf-textarea:focus {
    border-color: var(--lmf-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.lmf-input-date,
.lmf-input-time,
.lmf-input-datetime-local {
    min-height: 44px;
    cursor: pointer;
}

.lmf-field-error-msg {
    color: var(--lmf-error);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Radio & Checkbox Choices */
.lmf-choice-group {
    display: flex;
    margin-top: 6px;
}

.lmf-choice-group.lmf-layout-vertical {
    flex-direction: column;
    gap: 10px;
}

.lmf-choice-group.lmf-layout-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 18px;
}

.lmf-choice-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    color: var(--lmf-text);
    user-select: none;
    line-height: 1.4;
}

.lmf-radio-input,
.lmf-checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--lmf-primary);
    margin: 0;
    flex-shrink: 0;
}

.lmf-choice-label {
    font-weight: 500;
}

.lmf-help-text {
    font-size: 12px;
    color: var(--lmf-text-muted);
    margin-top: 5px;
    display: block;
}

/* File / Photo Upload Dropzone */
.lmf-file-dropzone {
    border: 2px dashed var(--lmf-border);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.lmf-file-dropzone:hover,
.lmf-file-dropzone.dragover {
    border-color: var(--lmf-primary);
    background: rgba(37, 99, 235, 0.04);
}

.lmf-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.lmf-upload-icon {
    width: 38px;
    height: 38px;
    color: var(--lmf-primary);
    margin-bottom: 8px;
    display: inline-block;
}

.lmf-file-text {
    display: block;
    font-size: 14px;
    color: var(--lmf-text);
    margin-bottom: 4px;
}

.lmf-file-text strong {
    color: var(--lmf-primary);
    text-decoration: underline;
}

.lmf-file-hint {
    display: block;
    font-size: 12px;
    color: var(--lmf-text-muted);
}

.lmf-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 10px;
    position: relative;
    z-index: 3;
}

.lmf-preview-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
}

.lmf-file-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.lmf-remove-file {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.lmf-remove-file:hover {
    background: #fecaca;
}

/* Navigation Buttons */
.lmf-navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.lmf-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: inherit;
}

.lmf-btn-prev {
    background: #f1f5f9;
    color: #475569;
}

.lmf-btn-prev:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.lmf-btn-next,
.lmf-btn-submit {
    background: var(--lmf-primary);
    color: #ffffff;
    margin-left: auto;
    transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.lmf-btn-next:hover,
.lmf-btn-submit:hover {
    background: var(--lmf-primary);
    filter: brightness(0.88);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.lmf-btn-next:active,
.lmf-btn-submit:active {
    filter: brightness(0.82);
    transform: translateY(1px);
}

.lmf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alert Box */
.lmf-alert-box {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.lmf-alert-box.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.lmf-alert-box.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 540px) {
    .lmf-form-wrapper {
        padding: 24px 16px;
        margin: 20px 10px;
    }
    .lmf-step-name {
        font-size: 11px;
    }
    .lmf-step-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .lmf-steps-header::before,
    .lmf-progress-line {
        top: 15px;
    }
}

/* ====================================================
   Instruction & Rich Text Content Block
   ==================================================== */
.lmf-instruction-block {
    flex: 0 0 100%;
    width: 100%;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.lmf-instruction-block.lmf-width-50 {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
}

.lmf-instruction-block.lmf-width-33 {
    flex: 0 0 calc(33.333% - 11px);
    max-width: calc(33.333% - 11px);
}

.lmf-instruction-inner {
    line-height: 1.6;
    font-size: 14px;
}

.lmf-instruction-inner p {
    margin: 0 0 8px 0;
}

.lmf-instruction-inner p:last-child {
    margin-bottom: 0;
}

.lmf-instruction-inner ul,
.lmf-instruction-inner ol {
    margin: 6px 0 6px 22px;
    padding: 0;
}

.lmf-instruction-normal .lmf-instruction-inner {
    color: var(--lmf-text);
}

.lmf-instruction-info .lmf-instruction-inner {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 6px;
    color: #1e3a8a;
}

.lmf-instruction-warning .lmf-instruction-inner {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 6px;
    color: #78350f;
}

.lmf-instruction-success .lmf-instruction-inner {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    padding: 12px 16px;
    border-radius: 6px;
    color: #064e3b;
}

/* Single Step Form Adjustments */
.lmf-is-single-step .lmf-steps-header {
    display: none !important;
}

.lmf-is-single-step .lmf-step::before {
    display: none !important;
    content: none !important;
}

