/* ==========================================================================
   Withdrawal page (form, confirmation, receipt)
   Accent color: --lw-accent, set inline from the module configuration.
   ========================================================================== */

/* The theme wraps the page in a boxed #content: keep a single card only. */
#module-legalwithdrawal-withdrawal #content {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    max-width: none;
}

#module-legalwithdrawal-withdrawal .page-header h1 {
    text-align: center;
    text-transform: none;
    font-size: 1.75rem;
    font-weight: 600;
    color: #1f2328;
    margin: 1.5rem 0 0.5rem;
}

.legalwithdrawal-page {
    --lw-accent-default: #2b2f33;
    --lw-color: var(--lw-accent, var(--lw-accent-default));
    --lw-text: #1f2328;
    --lw-muted: #5f6670;
    --lw-border: #d9dde2;
    --lw-soft: #f6f7f8;
    --lw-radius: 10px;

    max-width: 720px;
    margin: 0 auto 3rem;
    color: var(--lw-text);
    font-size: 1rem;
    line-height: 1.55;
}

.legalwithdrawal-page *,
.legalwithdrawal-page *::before,
.legalwithdrawal-page *::after {
    box-sizing: border-box;
}

/* Steps ------------------------------------------------------------------- */
.lw-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
    counter-reset: none;
}

.lw-steps__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--lw-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.lw-steps__item + .lw-steps__item::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2px;
    margin-right: 0.5rem;
    background: var(--lw-border);
}

.lw-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 2px solid var(--lw-border);
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

.lw-steps__item.is-active {
    color: var(--lw-text);
    font-weight: 700;
}

.lw-steps__item.is-active .lw-steps__num,
.lw-steps__item.is-done .lw-steps__num {
    border-color: var(--lw-color);
    background: var(--lw-color);
    color: #fff;
}

.lw-steps__item.is-done + .lw-steps__item::before,
.lw-steps__item.is-active + .lw-steps__item::before {
    background: var(--lw-border);
}

.lw-steps__item.is-done + .lw-steps__item.is-active::before,
.lw-steps__item.is-done + .lw-steps__item.is-done::before {
    background: var(--lw-color);
}

/* Intro ------------------------------------------------------------------- */
.lw-intro {
    margin-bottom: 1.25rem;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--lw-border);
    border-left: 4px solid var(--lw-color);
    border-radius: var(--lw-radius);
    background: var(--lw-soft);
}

.lw-intro__text {
    margin: 0 0 0.75rem;
    color: var(--lw-text);
    font-size: 0.9375rem;
}

.lw-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--lw-border);
    color: var(--lw-muted);
    font-size: 0.875rem;
}

.lw-badge strong {
    color: var(--lw-text);
}

/* Card -------------------------------------------------------------------- */
.lw-card {
    padding: 2rem;
    border: 1px solid var(--lw-border);
    border-radius: var(--lw-radius);
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

.lw-card__title {
    margin: 0 0 0.5rem;
    color: var(--lw-text);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
}

.lw-card__lead {
    margin: 0 0 1.5rem;
    color: var(--lw-muted);
    font-size: 0.9375rem;
}

.lw-empty {
    padding: 1rem 0;
    color: var(--lw-muted);
    text-align: center;
}

/* Form sections ----------------------------------------------------------- */
.lw-section {
    margin: 0;
    padding: 0 0 1.5rem;
    border: 0;
    border-bottom: 1px solid #eceef1;
    min-width: 0;
}

/* margin, not padding: a fieldset's padding ends up below its legend */
.lw-section + .lw-section {
    margin-top: 1.5rem;
}

.lw-section:last-of-type {
    padding-bottom: 0;
    border-bottom: 0;
}

.lw-section__title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: auto;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    color: var(--lw-text);
    font-size: 1.0625rem;
    font-weight: 700;
    text-transform: none;
}

.lw-section__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    background: var(--lw-soft);
    border: 1px solid var(--lw-border);
    color: var(--lw-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.lw-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 1rem;
}

@media (min-width: 576px) {
    .lw-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.lw-field {
    margin-bottom: 1rem;
}

.lw-field:last-child {
    margin-bottom: 0;
}

/* grid cells stack on mobile: keep the gap after the last one too */
.lw-grid > .lw-field {
    margin-bottom: 1rem;
}

.lw-label {
    display: block;
    margin: 0 0 0.375rem;
    color: var(--lw-text);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
}

.legalwithdrawal-page .lw-input,
.legalwithdrawal-page .form-control.lw-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0.625rem 0.875rem;
    border: 1px solid #c4cad1;
    border-radius: 8px;
    background: #fff;
    color: var(--lw-text);
    font-size: 1rem;
    line-height: 1.4;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.legalwithdrawal-page textarea.lw-input {
    min-height: 110px;
    resize: vertical;
}

.legalwithdrawal-page .lw-input:hover {
    border-color: #9aa3ad;
}

.legalwithdrawal-page .lw-input:focus {
    outline: 0;
    border-color: var(--lw-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--lw-color);
}

.lw-hint {
    display: block;
    margin-top: 0.375rem;
    color: var(--lw-muted);
    font-size: 0.8125rem;
}

.lw-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Declaration ------------------------------------------------------------- */
.lw-declaration {
    margin: 0 0 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--lw-border);
    border-left: 4px solid var(--lw-color);
    border-radius: 8px;
    background: var(--lw-soft);
    color: var(--lw-text);
    font-size: 0.9375rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.lw-confirm-text {
    margin: 0 0 1.25rem;
    color: var(--lw-text);
    font-weight: 600;
}

/* Receipt ----------------------------------------------------------------- */
.lw-success {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lw-success__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--lw-color);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.lw-success .lw-card__lead {
    margin-bottom: 0;
}

.lw-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.lw-facts__item {
    flex: 1 1 180px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--lw-border);
    border-radius: 8px;
}

.lw-facts dt {
    margin: 0 0 0.125rem;
    color: var(--lw-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

.lw-facts dd {
    margin: 0;
    color: var(--lw-text);
    font-size: 1.0625rem;
    font-weight: 700;
}

/* Buttons ----------------------------------------------------------------- */
.lw-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.legalwithdrawal-page .lw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.75rem;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: filter 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.legalwithdrawal-page .lw-btn--primary {
    background: var(--lw-color);
    border-color: var(--lw-color);
    color: #fff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.15);
}

.legalwithdrawal-page .lw-btn--primary:hover,
.legalwithdrawal-page .lw-btn--primary:focus {
    color: #fff;
    filter: brightness(1.12);
    text-decoration: none;
}

.legalwithdrawal-page .lw-btn--ghost {
    background: #fff;
    border-color: var(--lw-border);
    color: var(--lw-text);
}

.legalwithdrawal-page .lw-btn--ghost:hover,
.legalwithdrawal-page .lw-btn--ghost:focus {
    border-color: var(--lw-color);
    color: var(--lw-text);
    text-decoration: none;
}

.legalwithdrawal-page .lw-btn:focus-visible {
    outline: 3px solid var(--lw-color);
    outline-offset: 2px;
}

/* Mobile ------------------------------------------------------------------ */
@media (max-width: 575px) {
    .lw-card {
        padding: 1.25rem;
    }

    .lw-steps__label {
        display: none;
    }

    .lw-steps__item.is-active .lw-steps__label {
        display: inline;
    }

    .lw-steps__item + .lw-steps__item::before {
        width: 1.25rem;
    }

    .lw-actions .lw-btn {
        width: 100%;
    }
}

/* Print (receipt) --------------------------------------------------------- */
@media print {
    #header,
    #footer,
    .footer-container,
    .lw-steps,
    .lw-actions {
        display: none !important;
    }

    .lw-card {
        box-shadow: none;
        border: 0;
        padding: 0;
    }
}

/* ==========================================================================
   Hooks (order detail, account, footer, order confirmation)
   ========================================================================== */

.legalwithdrawal-order-detail {
    margin: 1.5rem 0;
}

.legalwithdrawal-order-btn {
    font-weight: 600;
}

.page-my-account .links .legalwithdrawal-account-tile,
.account-menu .legalwithdrawal-account-tile {
    display: block;
    text-decoration: none;
    color: inherit;
}

.page-my-account .links .legalwithdrawal-account-tile .link-item,
.account-menu .legalwithdrawal-account-tile .link-item {
    display: block;
}

.legalwithdrawal-footer-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: inherit;
    text-decoration: underline;
}

.legalwithdrawal-footer-link:hover {
    text-decoration: underline;
    opacity: 0.85;
}

#footer .legalwithdrawal-footer-link,
footer .legalwithdrawal-footer-link {
    color: inherit;
}

.legalwithdrawal-footer {
    margin: 0.75rem 0;
}

.legalwithdrawal-footer .legalwithdrawal-footer-link {
    margin-top: 0;
    font-weight: 600;
}

.legalwithdrawal-footer-displayBeforeBodyClosingTag {
    padding: 0.75rem 15px;
    text-align: center;
}

.legalwithdrawal-confirmation-box {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
}

.legalwithdrawal-confirmation-text {
    margin-bottom: 0.75rem;
}
