/* CSS/pro-modal.css
 *
 * The Pro modal (components/pro-modal.php, js/pro-modal.js): the app's Pro
 * sales page in a dialog — the BorderTanker Pro lockup, two headline lines
 * about what was just clicked (black, then lit orange), what Pro gives, and
 * the lit "Koop BorderTanker Pro" button.
 *
 * A native <dialog>: showModal() gives the backdrop, Escape and the focus trap.
 * Own class names (not .modal), because map.php and station.php style .modal
 * each in their own way.
 */

dialog.pro-modal {
    box-sizing: border-box;
    width: min(440px, calc(100vw - 32px));
    max-width: none;
    max-height: min(720px, calc(100dvh - 32px));
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: #fff;
    color: var(--color-text, #212529);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* Closed means hidden. Bootstrap's normalize (bootstrap.min.css) sets
 * `dialog { display: block }`, which overrides the browser's own hiding of a
 * closed <dialog> and left the modal standing at the bottom of the page. */
dialog.pro-modal:not([open]) {
    display: none;
}

/*
 * In and out as every other modal on the site (.modal / .modal__dialog
 * fade-in/fade-out in styles.css, the map's Voorkeuren modal): the card drops
 * in from 20px above at 95% in 0.3s, the backdrop fades in 0.2s; closing runs
 * it back in 0.2s. js/pro-modal.js adds .is-closing and only really closes the
 * dialog once the animation is done. Own keyframe names, so this works on a
 * page without styles.css.
 */
dialog.pro-modal[open] {
    display: flex;
    animation: pro-modal-in 0.3s ease-out;
}

dialog.pro-modal::backdrop {
    /* The page behind dimmed and blurred, as the other modals. */
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: pro-modal-fade-in 0.2s ease-in-out;
}

dialog.pro-modal.is-closing {
    animation: pro-modal-out 0.2s ease-in-out forwards;
}

dialog.pro-modal.is-closing::backdrop {
    animation: pro-modal-fade-out 0.2s ease-in-out forwards;
}

@keyframes pro-modal-in {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pro-modal-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

@keyframes pro-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pro-modal-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

html.pro-modal-open {
    overflow: hidden;
}

.pro-modal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.pro-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text, #212529);
    cursor: pointer;
}

.pro-modal-close svg { width: 18px; height: 18px; }
.pro-modal-close:hover { background: rgba(0, 0, 0, 0.09); }
.pro-modal-close:focus-visible { outline: 2px solid var(--color-primary-700, #c9633a); outline-offset: 2px; }

.pro-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 24px 8px;
}

/* --- Lockup + the two lines ----------------------------------------------- */
.pro-modal-body .bt-lockup {
    margin-right: 40px; /* clear of the close button */
}

.pro-modal-headline {
    margin: 18px 0 20px;
    font-family: var(--bt-lockup-font);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.pro-modal-title,
.pro-modal-lit {
    display: block;
}

.pro-modal-title {
    color: var(--color-text, #212529);
}

/* --- What Pro gives ------------------------------------------------------- */
.pro-modal-features {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pro-modal-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pro-modal-feature-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(var(--rgb-primary, 243, 134, 81), 0.12);
    color: var(--color-primary-700, #c9633a);
}

.pro-modal-feature-icon svg { width: 19px; height: 19px; }

/* The feature they clicked: the brand orange, filled. */
.pro-modal-feature.is-first .pro-modal-feature-icon {
    background: var(--color-primary, #F38651);
    color: #000;
}

.pro-modal-feature-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-muted, #6c757d);
}

.pro-modal-feature-text strong {
    color: var(--color-text, #212529);
    font-size: 0.97rem;
    font-weight: 700;
}

.pro-modal-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-muted, #6c757d);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: 2px;
}

/* --- Buy ------------------------------------------------------------------ */
.pro-modal-footer {
    flex: 0 0 auto;
    display: grid;
    gap: 6px;
    padding: 14px 24px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
}

.pro-modal-price {
    margin: 2px 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-muted, #6c757d);
}

.pro-modal-later {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    text-decoration: none;
    padding: 0 16px;
    border: 0;
    background: none;
    color: var(--color-text, #212529);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.pro-modal-later:hover,
.pro-modal-later:focus-visible {
    color: var(--color-text, #212529);
    text-decoration: none;
}

/* "Wat biedt BorderTanker Pro?": a step quieter than "Ik heb al een account". */
.pro-modal-secondary {
    min-height: 32px;
    color: var(--color-muted, #6c757d);
    font-weight: 500;
    font-size: 0.88rem;
}

.pro-modal-later:focus-visible { outline: 2px solid var(--color-primary-700, #c9633a); outline-offset: 2px; border-radius: 8px; }

@media (max-width: 480px) {
    .pro-modal-body { padding: 20px 18px 8px; }
    .pro-modal-footer { padding: 12px 18px 14px; }
    .pro-modal-headline { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
    dialog.pro-modal[open],
    dialog.pro-modal::backdrop,
    dialog.pro-modal.is-closing,
    dialog.pro-modal.is-closing::backdrop { animation: none; }
}
