/**
 * Staw Albis Leasing – Checkout & Modal Styles
 * CSS-Prefix: staw-albis-
 */

.staw-albis-wrapper {
    --staw-albis-primary: #1a3a6e;
    --staw-albis-accent: #e30613;
    --staw-albis-bg: #f7f9fc;
    --staw-albis-border: #d9dfe8;
    --staw-albis-text: #1d2433;
    --staw-albis-muted: #667085;
    --staw-albis-error: #b42318;
    --staw-albis-radius: 8px;

    background: var( --staw-albis-bg );
    border: 1px solid var( --staw-albis-border );
    border-radius: var( --staw-albis-radius );
    padding: 20px;
    color: var( --staw-albis-text );
    font-size: 14px;
    line-height: 1.5;
}

/* ---- Header ---- */
.staw-albis-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var( --staw-albis-border );
}
.staw-albis-header__logo {
    max-height: 44px;
    width: auto;
}
.staw-albis-header__claim {
    margin: 0;
    color: var( --staw-albis-muted );
    font-size: 13px;
}

/* ---- Fieldsets ---- */
.staw-albis-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 24px 0;
}
.staw-albis-fieldset > legend {
    font-weight: 600;
    font-size: 15px;
    color: var( --staw-albis-primary );
    padding: 0 0 10px 0;
    margin-bottom: 8px;
    border: none;
    width: 100%;
}

/* ---- Rows & Fields ---- */
.staw-albis-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.staw-albis-field {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
}
.staw-albis-field--wide {
    flex: 2 1 320px;
}
.staw-albis-field--narrow {
    flex: 0 1 140px;
}
.staw-albis-field--button {
    flex: 0 0 auto;
    justify-content: flex-end;
}
.staw-albis-field label,
.staw-albis-field__label-block {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 13px;
}
.staw-albis-field abbr {
    color: var( --staw-albis-accent );
    border: none;
    text-decoration: none;
    margin-left: 2px;
}

/* ---- Inputs ---- */
.staw-albis-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var( --staw-albis-border );
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: var( --staw-albis-text );
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.staw-albis-input:focus {
    outline: none;
    border-color: var( --staw-albis-primary );
    box-shadow: 0 0 0 3px rgba( 26, 58, 110, 0.12 );
}
.staw-albis-input--error {
    border-color: var( --staw-albis-error );
    box-shadow: 0 0 0 3px rgba( 180, 35, 24, 0.08 );
}
.staw-albis-field-error {
    color: var( --staw-albis-error );
    font-size: 12px;
    margin-top: 4px;
    display: block;
}
.staw-albis-input--plz {
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}
.staw-albis-hint {
    display: block;
    margin-top: 4px;
    color: var( --staw-albis-muted );
    font-size: 12px;
}

/* ---- Recalc Button ---- */
.staw-albis-btn-recalc {
    background: var( --staw-albis-primary );
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 500;
    cursor: pointer;
    min-height: 38px;
    align-self: flex-end;
}
.staw-albis-btn-recalc:hover {
    background: #14305c;
}

/* ---- Rate Cards ---- */
.staw-albis-rates-container {
    min-height: 80px;
}
.staw-albis-rates {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 140px, 1fr ) );
    gap: 10px;
}
.staw-albis-rate-card {
    position: relative;
    display: block;
    cursor: pointer;
}
.staw-albis-rate-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.staw-albis-rate-card__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    background: #fff;
    border: 2px solid var( --staw-albis-border );
    border-radius: 8px;
    transition: all .15s;
    text-align: center;
}
.staw-albis-rate-card input[type="radio"]:checked + .staw-albis-rate-card__body {
    border-color: var( --staw-albis-primary );
    background: #eff3fb;
    box-shadow: 0 2px 6px rgba( 26, 58, 110, 0.15 );
}
.staw-albis-rate-card__laufzeit {
    font-size: 18px;
    font-weight: 600;
    color: var( --staw-albis-primary );
    line-height: 1.1;
}
.staw-albis-rate-card__laufzeit small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var( --staw-albis-muted );
    margin-top: 2px;
}
.staw-albis-rate-card__rate {
    margin-top: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var( --staw-albis-text );
}
.staw-albis-rate-card__rate small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var( --staw-albis-muted );
}
.staw-albis-rate-card:hover .staw-albis-rate-card__body {
    border-color: var( --staw-albis-primary );
}

/* ---- Date Row ---- */
.staw-albis-date-row {
    display: flex;
    gap: 8px;
    width: 100%;
}
.staw-albis-date-row select {
    flex: 1;
}

/* ---- GF Fieldset ---- */
.staw-albis-fieldset--gf {
    background: #fff;
    border: 1px solid var( --staw-albis-border );
    border-radius: var( --staw-albis-radius );
    padding: 16px;
}

/* ---- AGB ---- */
.staw-albis-agb {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var( --staw-albis-border );
    border-radius: var( --staw-albis-radius );
}
.staw-albis-agb__label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}
.staw-albis-agb__label input {
    margin-top: 3px;
}

/* ---- Messages ---- */
.staw-albis-intro {
    margin: 0 0 14px;
    color: var( --staw-albis-muted );
    font-size: 13px;
}
.staw-albis-error {
    color: var( --staw-albis-error );
    background: #fef3f2;
    border: 1px solid #fecdca;
    padding: 10px 12px;
    border-radius: 6px;
    margin: 0;
}
.staw-albis-loading {
    color: var( --staw-albis-muted );
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ---- Thank-You Section ---- */
.staw-albis-thankyou {
    margin: 30px 0;
    padding: 20px;
    background: #f0f6ff;
    border-left: 4px solid #1a3a6e;
    border-radius: 6px;
}
.staw-albis-thankyou h2 {
    margin-top: 0;
    color: #1a3a6e;
}
.staw-albis-thankyou__list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}
.staw-albis-thankyou__list li {
    padding: 4px 0;
}

/* ---- Admin meta block ---- */
.staw-albis-admin-meta h3 {
    margin-top: 0;
}

/* ---- Product Page CTA Card (Screenshot 1) ---- */
.staw-albis-product-cta {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 16px 20px;
    margin: 16px 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}
.staw-albis-product-cta__logo {
    flex: 0 0 auto;
    width: 88px;
    padding-top: 4px;
}
.staw-albis-product-cta__logo img {
    max-width: 100%;
    height: auto;
    display: block;
}
.staw-albis-product-cta__body {
    flex: 1 1 auto;
    min-width: 0;
}
.staw-albis-product-cta__title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: #1d2433;
    line-height: 1.3;
}
.staw-albis-product-cta__text {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}
.staw-albis-product-trigger {
    display: inline-block;
    padding: 9px 20px;
    background: #4a5159;
    color: #fff;
    border: none;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    line-height: 1.2;
}
.staw-albis-product-trigger:hover,
.staw-albis-product-trigger:focus {
    background: #333942;
    color: #fff;
    text-decoration: underline;
}
@media ( max-width: 480px ) {
    .staw-albis-product-cta {
        flex-direction: column;
    }
    .staw-albis-product-cta__logo {
        width: 100px;
    }
}

/* ---- Modal (Screenshot 2) ---- */
.staw-albis-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
}
.staw-albis-modal--open {
    display: block;
}
.staw-albis-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba( 0, 0, 0, 0.55 );
}
.staw-albis-modal__dialog {
    position: relative;
    max-width: 860px;
    width: calc( 100% - 32px );
    margin: 6vh auto;
    background: #fff;
    border-radius: 4px;
    padding: 32px 40px 28px;
    box-shadow: 0 24px 64px rgba( 0, 0, 0, 0.3 );
    max-height: 88vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.staw-albis-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    color: #667085;
    line-height: 1;
    padding: 0;
}
.staw-albis-modal__close:hover {
    color: #1d2433;
}
.staw-albis-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding-right: 40px;
    margin-bottom: 24px;
}
.staw-albis-modal__header-text {
    flex: 1 1 auto;
    min-width: 0;
}
.staw-albis-modal__title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    color: #1d2433;
    line-height: 1.2;
}
.staw-albis-modal__subtitle {
    margin: 0;
    font-size: 14px;
    color: #4a5159;
    line-height: 1.4;
}
.staw-albis-modal__logo {
    flex: 0 0 auto;
    width: 140px;
    height: auto;
}

/* Table */
.staw-albis-product-rates {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.staw-albis-product-rates th {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid #1d2433;
    font-weight: 700;
    color: #1d2433;
    font-size: 14px;
    background: transparent;
}
.staw-albis-product-rates td {
    padding: 12px 14px;
    font-size: 14px;
    color: #1d2433;
    border-bottom: 1px solid #eef0f3;
}
.staw-albis-product-rates tbody tr:nth-child( even ) td {
    background: #f8f9fa;
}

/* Footer text & footnotes */
.staw-albis-modal__footer-text {
    margin: 0 0 16px;
    font-size: 14px;
    color: #1d2433;
    line-height: 1.5;
}
.staw-albis-modal__footnotes {
    font-size: 12px;
    color: #4a5159;
    line-height: 1.5;
}
.staw-albis-modal__footnotes p {
    margin: 0 0 4px;
}
.staw-albis-modal__notice {
    padding: 16px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 4px;
    color: #744210;
    font-size: 14px;
}

@media ( max-width: 640px ) {
    .staw-albis-modal__dialog {
        padding: 24px 20px 20px;
    }
    .staw-albis-modal__header {
        flex-direction: column-reverse;
        align-items: flex-start;
    }
    .staw-albis-modal__logo {
        width: 110px;
    }
    .staw-albis-product-rates th,
    .staw-albis-product-rates td {
        padding: 10px 8px;
        font-size: 13px;
    }
}

/* ---- Responsive ---- */
@media ( max-width: 640px ) {
    .staw-albis-field-row {
        flex-direction: column;
    }
    .staw-albis-field {
        flex: 1 1 100%;
    }
    .staw-albis-btn-recalc {
        width: 100%;
    }
}
