/* ── ESAL Frontend Form ── */

/* Reset & base */
.eff-form {
    max-width: 720px;
    margin: 2rem 0;
    font-family: inherit;
}

.eff-form *,
.eff-form *::before,
.eff-form *::after {
    box-sizing: border-box;
}

/* Conditional logic: hidden fields */
.eff-field--hidden {
    display: none !important;
}

/* Notices */
.eff-notice {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.eff-notice--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.eff-notice--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.eff-notice--error p {
    margin: 0.25rem 0;
}

.eff-error {
    color: #721c24;
    background: #f8d7da;
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

/* Input error state */
.eff-input--error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.eff-client-error {
    color: #721c24;
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

/* Fields */
.eff-field {
    margin-bottom: 1.25rem;
}

.eff-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.eff-required {
    color: #c0392b;
    font-weight: bold;
}

.eff-input,
.eff-textarea,
.eff-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.eff-input:focus,
.eff-textarea:focus,
.eff-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
    outline: none;
}

.eff-input--color {
    width: 80px;
    height: 40px;
    padding: 2px;
    cursor: pointer;
}

.eff-textarea--large {
    min-height: 160px;
}

.eff-instructions {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: #666;
    line-height: 1.4;
}

/* Fieldsets */
.eff-fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.eff-legend {
    font-weight: 700;
    font-size: 1rem;
    padding: 0 0.5rem;
    color: #1a1a1a;
}

.eff-fieldset--inline {
    border: none;
    padding: 0;
    margin: 0;
}

.eff-fieldset--inline .eff-label {
    margin-bottom: 0.5rem;
}

/* Radio & Checkbox */
.eff-radio-label,
.eff-checkbox-label {
    display: block;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    cursor: pointer;
}

.eff-radio-label input,
.eff-checkbox-label input {
    margin-right: 0.4rem;
}

/* Repeater */
.eff-repeater {
    background: #fafafa;
}

.eff-repeater-row {
    padding: 0.75rem 0;
    border-bottom: 1px dashed #ddd;
    position: relative;
}

.eff-repeater-row:last-child {
    border-bottom: none;
}

.eff-repeater-remove {
    margin-top: 0.5rem;
}

.eff-repeater-add {
    margin-top: 0.75rem;
}

/* Buttons */
.eff-btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.eff-btn:active {
    transform: scale(0.98);
}

.eff-btn--primary {
    background: #2271b1;
    color: #fff;
}

.eff-btn--primary:hover {
    background: #135e96;
}

.eff-btn--secondary {
    background: #f0f0f1;
    color: #1a1a1a;
    border: 1px solid #ccc;
}

.eff-btn--secondary:hover {
    background: #e0e0e1;
}

.eff-btn--small {
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
}

/* Honeypot - hidden */
.eff-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* Terms & Privacy */
.eff-field--terms {
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.eff-terms-label {
    font-size: 0.9rem;
    line-height: 1.5;
}

.eff-terms-label a {
    color: #2271b1;
    text-decoration: underline;
}

.eff-terms-label a:hover {
    color: #135e96;
}

/* ── Tabs ── */
.eff-tabs {
    margin-bottom: 1.25rem;
}

.eff-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.25rem;
}

.eff-tabs .eff-tabs__btn {
    padding: 0.65rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: inherit;
}

.eff-tabs .eff-tabs__btn:hover,
.eff-tabs .eff-tabs__btn:focus {
    color: #2271b1;
    background: none;
}

.eff-tabs .eff-tabs__btn--active,
.eff-tabs .eff-tabs__btn--active:hover,
.eff-tabs .eff-tabs__btn--active:focus {
    color: #2271b1;
    border-bottom-color: #2271b1;
    background: none;
}

.eff-tabs__panel {
    display: none;
}

.eff-tabs__panel--active {
    display: block;
}

/* ── Accordion ── */
.eff-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.eff-accordion__header {
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a1a;
    cursor: pointer;
    background: #f9f9f9;
    transition: background 0.2s;
    user-select: none;
    list-style: none;
}

.eff-accordion__header::-webkit-details-marker {
    display: none;
}

.eff-accordion__header::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.eff-accordion[open] > .eff-accordion__header::before {
    transform: rotate(90deg);
}

.eff-accordion__header:hover {
    background: #f0f0f1;
}

.eff-accordion__body {
    padding: 1rem 1.25rem;
}

/* ── Wizard / Steps ── */
.eff-wizard {
    margin-bottom: 1.25rem;
}

.eff-wizard__progress {
    display: flex;
    justify-content: space-between;
    counter-reset: step;
    margin-bottom: 1.5rem;
    position: relative;
}

.eff-wizard__progress::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.eff-wizard__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.eff-wizard__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    transition: background 0.3s, color 0.3s;
}

.eff-wizard__label {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.eff-wizard__step--active .eff-wizard__number {
    background: #2271b1;
    color: #fff;
}

.eff-wizard__step--active .eff-wizard__label {
    color: #2271b1;
    font-weight: 600;
}

.eff-wizard__step--done {
    cursor: pointer;
}

.eff-wizard__step--done .eff-wizard__number {
    background: #28a745;
    color: #fff;
}

.eff-wizard__step--done .eff-wizard__number::after {
    content: '✓';
    font-size: 0.85rem;
}

.eff-wizard__step--done .eff-wizard__number {
    font-size: 0;
}

.eff-wizard__step--done .eff-wizard__label {
    color: #28a745;
}

.eff-wizard__panel {
    display: none;
}

.eff-wizard__panel--active {
    display: block;
    animation: effFadeIn 0.3s ease;
}

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

.eff-wizard__nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.eff-wizard__nav .eff-btn:only-child {
    margin-left: auto;
}

/* Responsive */
@media (max-width: 600px) {
    .eff-form {
        margin: 1rem 0;
    }

    .eff-input,
    .eff-textarea,
    .eff-select {
        font-size: 1rem;
    }

    .eff-tabs__nav {
        flex-direction: column;
        border-bottom: none;
        gap: 2px;
    }

    .eff-tabs .eff-tabs__btn {
        border-bottom: none;
        border-left: 2px solid transparent;
        margin-bottom: 0;
        text-align: left;
    }

    .eff-tabs .eff-tabs__btn--active,
    .eff-tabs .eff-tabs__btn--active:hover,
    .eff-tabs .eff-tabs__btn--active:focus {
        border-left-color: #2271b1;
        background: #f0f7fc;
    }

    .eff-wizard__progress::before {
        display: none;
    }

    .eff-wizard__progress {
        flex-direction: column;
        gap: 0.5rem;
    }

    .eff-wizard__step {
        flex-direction: row;
        gap: 0.5rem;
    }

    .eff-wizard__number {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .eff-wizard__label {
        white-space: normal;
        text-align: left;
    }
}
