/* =============================================================================
   FDL Eligibility Tool — Frontend Styles
   Préfixe: .fdl-
   Inspiré des styles .contact-page/.eligible-page du thème WMDW
   ============================================================================= */

/* Variables */
:root {
    --fdl-black: #24282a;
    --fdl-blue: #158795;
    --fdl-blue-dark: #435b58;
    --fdl-beige: #eae3d9;
    --fdl-white: #fff;
    --fdl-error: #c0392b;
    --fdl-success: #158795;
    --fdl-border: rgba(36, 40, 42, 0.25);
    --fdl-muted: rgba(36, 40, 42, 0.56);
    --fdl-radius: 3px;
    --fdl-transition: all 0.25s ease;
}

/* =============================================================================
   Wrapper
   ============================================================================= */
.fdl-eligibility-form {
    width: min(900px, 100%);
    margin-left: auto;
    margin-right: auto;
}

/* =============================================================================
   Page intro
   ============================================================================= */
.fdl-page-intro {
    margin-bottom: 2.5rem;
}

.fdl-page-title {
    font-size: 34px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    line-height: 1.35;
    color: var(--fdl-black);
    margin-bottom: 1rem;
}

.fdl-page-intro-text {
    font-size: 17px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    line-height: 1.8;
    color: var(--fdl-black);
}

.fdl-page-intro-text p:last-child {
    margin-bottom: 0;
}

.fdl-intro-divider {
    border: none;
    border-top: 2px solid rgba(36, 40, 42, 0.15);
    margin: 2.5rem 0 0;
}

@media screen and (max-width: 1024px) {
    .fdl-page-title {
        font-size: 29px;
    }
}
@media screen and (max-width: 768px) {
    .fdl-page-title {
        font-size: 25px;
    }
}

/* =============================================================================
   Progress indicator (2 steps, tooltip on hover)
   ============================================================================= */
.fdl-progress {
    margin-bottom: 3rem;
}

.fdl-progress[hidden] {
    display: none !important;
}

.fdl-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.fdl-progress-step {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--fdl-border);
    color: var(--fdl-muted);
    font-size: 14px;
    font-family: "Poppins Medium", sans-serif;
    font-weight: 500;
    transition: var(--fdl-transition);
    background: transparent;
    flex-shrink: 0;
    cursor: default;
}

/* Tooltip via data-label attribute */
.fdl-progress-step::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fdl-black);
    color: var(--fdl-white);
    padding: 5px 10px;
    border-radius: var(--fdl-radius);
    font-size: 11px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fdl-progress-step:hover::after {
    opacity: 1;
}

.fdl-progress-step.active {
    border-color: var(--fdl-blue);
    color: var(--fdl-blue);
    background: rgba(21, 135, 149, 0.08);
}

.fdl-progress-step.done {
    border-color: var(--fdl-blue);
    background: var(--fdl-blue);
    color: var(--fdl-white);
}

.fdl-progress-line {
    flex: 1;
    max-width: 80px;
    height: 2px;
    background: var(--fdl-border);
    transition: background 0.3s ease;
}

/* =============================================================================
   Steps
   ============================================================================= */
.fdl-step {
    display: none;
    animation: fdl-fade-in 0.35s ease forwards;
}

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

@keyframes fdl-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   Fields
   ============================================================================= */
.fdl-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.fdl-field {
    position: relative;
    padding-top: 1.25rem;
}

/* Numeric counter label (01, 02…) */
.fdl-field::before {
    content: attr(data-index);
    position: absolute;
    top: 0;
    left: 0;
    font-size: 11px;
    line-height: 2.5;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    color: var(--fdl-muted);
}

.fdl-field[data-index="1"]::before {
    content: "01";
}
.fdl-field[data-index="2"]::before {
    content: "02";
}
.fdl-field[data-index="3"]::before {
    content: "03";
}
.fdl-field[data-index="4"]::before {
    content: "04";
}
.fdl-field[data-index="5"]::before {
    content: "05";
}

.fdl-label {
    display: block;
    font-size: 13px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    color: var(--fdl-muted);
    margin-bottom: 0.4rem;
}

.fdl-required {
    color: var(--fdl-blue);
}

/* =============================================================================
   Inputs
   ============================================================================= */
.fdl-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--fdl-black);
    background: transparent;
    color: var(--fdl-black);
    font-size: 20px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    line-height: initial;
    padding: 0.2rem 0;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.fdl-input::placeholder {
    color: var(--fdl-muted);
}

.fdl-input:focus {
    border-bottom-color: var(--fdl-blue);
    outline: none;
}

.fdl-input--invalid,
.fdl-input--invalid:focus {
    border-bottom-color: var(--fdl-error) !important;
}

/* Remove number input arrows */
.fdl-input[type="number"]::-webkit-outer-spin-button,
.fdl-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.fdl-input[type="number"] {
    -moz-appearance: textfield;
}

/* =============================================================================
   Select
   ============================================================================= */
.fdl-select-wrapper {
    position: relative;
}

.fdl-select-wrapper::after {
    content: "";
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--fdl-black);
}

.fdl-select {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--fdl-black);
    background: transparent;
    color: var(--fdl-muted);
    font-size: 20px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    padding: 0.2rem 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.fdl-select:focus {
    border-bottom-color: var(--fdl-blue);
    outline: none;
}

.fdl-select.option-selected,
.fdl-select:valid {
    color: var(--fdl-black);
}

.fdl-select--invalid {
    border-bottom-color: var(--fdl-error);
}

@media screen and (max-width: 1024px) {
    .fdl-input,
    .fdl-select {
        font-size: 18px;
    }
}

@media screen and (max-width: 768px) {
    .fdl-input,
    .fdl-select {
        font-size: 16px;
    }
}

/* =============================================================================
   Error messages
   ============================================================================= */
.fdl-error {
    display: block;
    color: var(--fdl-error);
    font-size: 12px;
    font-family: "Poppins Light", sans-serif;
    line-height: 1.5;
    margin-top: 0.35rem;
    min-height: 1rem;
}

.fdl-global-error {
    display: none;
    color: var(--fdl-error);
    font-size: 14px;
    padding: 0.75rem 0;
    margin-top: 1rem;
    border-top: 1px solid rgba(192, 57, 43, 0.2);
}

.fdl-global-error.fdl-global-error--visible {
    display: block;
}

/* =============================================================================
   Step actions
   ============================================================================= */
.fdl-step-actions {
    margin-top: 2rem;
}

/* =============================================================================
   Buttons
   ============================================================================= */
.fdl-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 16px;
    font-family: "Poppins Medium", sans-serif;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: var(--fdl-transition);
    border: none;
    background: transparent;
    color: var(--fdl-black);
}

.fdl-btn::before,
.fdl-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--fdl-radius);
    transition: var(--fdl-transition);
}

.fdl-btn::before {
    background: var(--fdl-black);
    z-index: -1;
}

.fdl-btn::after {
    border: 1px solid var(--fdl-black);
}

.fdl-btn,
.fdl-btn:visited {
    color: var(--fdl-white);
}

.fdl-btn:hover {
    color: var(--fdl-white);
    opacity: 0.85;
}

.fdl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fdl-btn--secondary {
    font-size: 14px;
    margin-top: 1.5rem;
    color: var(--fdl-muted);
    padding: 0.5rem 0;
    border: none;
    background: transparent;
}

.fdl-btn--secondary::before,
.fdl-btn--secondary::after {
    display: none;
}

.fdl-btn--secondary:hover {
    color: var(--fdl-blue);
    opacity: 1;
    text-decoration: underline;
}

/* Contact button: teal on white result card */
.fdl-result-action {
    display: block;
    margin-bottom: 0;
}

.fdl-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.fdl-btn--contact {
    color: var(--fdl-white);
}

.fdl-btn--contact::before {
    background: var(--fdl-blue);
}

.fdl-btn--contact::after {
    border-color: var(--fdl-blue);
}

.fdl-btn--contact:hover {
    color: var(--fdl-white);
    opacity: 0.88;
}

.fdl-btn-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.fdl-btn:hover .fdl-btn-arrow {
    transform: translateX(4px);
}

@media screen and (max-width: 1024px) {
    .fdl-btn {
        padding: 0.5rem 1rem;
    }
}

/* =============================================================================
   hCaptcha wrapper
   ============================================================================= */
.fdl-captcha {
    margin: 1.5rem 0;
}

/* =============================================================================
   Honeypot
   ============================================================================= */
.fdl-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* =============================================================================
   Loading (controlled via .fdl-loading--active class, not hidden attribute)
   ============================================================================= */
.fdl-loading {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    color: var(--fdl-muted);
    font-size: 15px;
}

.fdl-loading.fdl-loading--active {
    display: flex;
}

.fdl-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--fdl-border);
    border-top-color: var(--fdl-blue);
    border-radius: 50%;
    animation: fdl-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes fdl-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================================
   Result zone
   ============================================================================= */
.fdl-result {
    animation: fdl-fade-in 0.4s ease forwards;
}

.fdl-result--active {
    display: block;
}

.fdl-result-content {
    background: var(--fdl-white);
    border: 1px solid rgba(36, 40, 42, 0.12);
    border-left: 4px solid var(--fdl-blue);
    border-radius: var(--fdl-radius);
    padding: 2.5rem 2.5rem 2rem;
    box-shadow: 0 4px 24px rgba(36, 40, 42, 0.07);
    isolation: isolate;
}

.fdl-result-icon {
    font-size: 36px;
    margin-bottom: 1.25rem;
    line-height: 1;
}

.fdl-result-icon--success {
    color: var(--fdl-blue);
}

.fdl-result-icon--info {
    color: var(--fdl-blue-dark);
}

.fdl-result-text {
    font-size: 17px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    line-height: 1.85;
    color: var(--fdl-black);
    margin-bottom: 2rem;
}

@media screen and (max-width: 1024px) {
    .fdl-result-content {
        padding: 2rem 1.75rem 1.75rem;
    }
    .fdl-result-text {
        font-size: 16px;
    }
}

@media screen and (max-width: 768px) {
    .fdl-result-content {
        padding: 1.5rem 1.25rem;
    }
    .fdl-result-text {
        font-size: 15px;
    }
}

/* =============================================================================
   Contact confirm message
   ============================================================================= */
.fdl-contact-confirm {
    display: block;
    margin-top: 1rem;
    font-size: 15px;
    font-family: "Poppins Light", sans-serif;
    color: var(--fdl-blue);
    line-height: 1.6;
}

.fdl-contact-confirm--error {
    color: var(--fdl-error);
}

/* =============================================================================
   Result title
   ============================================================================= */
.fdl-result-title {
    font-size: 22px;
    font-family: "Poppins Medium", sans-serif;
    font-weight: 500;
    color: var(--fdl-black);
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

/* Per-variant accent (left border) */
.fdl-result-content--1 {
    border-left-color: var(--fdl-blue);
}

.fdl-result-content--2 {
    border-left-color: #f0a500;
}

.fdl-result-content--3 {
    border-left-color: var(--fdl-blue-dark);
}

/* =============================================================================
   Retry button
   ============================================================================= */
.fdl-retry-btn {
    display: inline-block;
    margin-top: 1.75rem;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    color: var(--fdl-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.fdl-retry-btn:hover {
    color: var(--fdl-black);
}

/* =============================================================================
   Contact sub-form (shown in result after eligibility check)
   ============================================================================= */
.fdl-contact-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(36, 40, 42, 0.12);
}

.fdl-contact-fields[hidden] {
    display: none !important;
}

.fdl-contact-form-intro {
    margin-bottom: 2rem;
}

.fdl-contact-form-title {
    font-size: 20px;
    font-family: "Poppins Medium", sans-serif;
    font-weight: 500;
    color: var(--fdl-black);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.fdl-contact-form-subtitle {
    font-size: 15px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    color: var(--fdl-muted);
    margin: 0;
    line-height: 1.65;
}

/* RGPD notice block */
.fdl-gdpr-notice {
    background: rgba(36, 40, 42, 0.04);
    border-left: 3px solid var(--fdl-blue);
    border-radius: var(--fdl-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 13px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    line-height: 1.75;
    color: var(--fdl-black);
}

.fdl-gdpr-notice p:last-child {
    margin-bottom: 0;
}

/* Radio group */
.fdl-field--radio {
    padding-top: 1.25rem;
}

.fdl-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: flex-start;
}

.fdl-radio-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 17px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    color: var(--fdl-black);
    cursor: pointer;
}

.fdl-radio-label input[type="radio"] {
    accent-color: var(--fdl-blue);
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Consent checkbox */
.fdl-consent-field {
    margin-top: 0.5rem;
    padding-top: 0;
}

.fdl-consent-field::before {
    display: none;
}

.fdl-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 13px;
    font-family: "Poppins Light", sans-serif;
    font-weight: 300;
    line-height: 1.65;
    color: var(--fdl-black);
    cursor: pointer;
}

.fdl-checkbox-label input[type="checkbox"] {
    accent-color: var(--fdl-blue);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 3px;
    cursor: pointer;
}

.fdl-checkbox-label a {
    color: var(--fdl-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fdl-checkbox-label a:hover {
    opacity: 0.8;
}

@media screen and (max-width: 768px) {
    .fdl-radio-label {
        font-size: 15px;
    }
}
