/* ==========================================================================
   BankID Login Page — Mina sidor (logged out landing)
   Hero + feature list + articles + FAQ, shown by [bankid_login layout="landing"].
   Copy comes from data/login-page-content.json — this file only styles it.
   Tokens are the suite-wide --svea-* set from assets/css/colors.css.
   ========================================================================== */

.bankid-landing {
    background: var(--svea-blue-pale, #E5F7FF);
    border: 1px solid var(--svea-card-bg, #fff);
    border-radius: var(--svea-radius, 16px);
    box-shadow: 0 4px 14px rgba(14, 58, 92, 0.05);
    padding: 48px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.bankid-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 48px;
}

.bankid-hero-text {
    flex: 1;
    min-width: 0;
    max-width: 480px;
}

.bankid-hero-title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--svea-navy, #0E3A5C);
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

.bankid-hero-desc {
    font-size: 16px;
    line-height: 1.6;
    color: var(--svea-muted, #5B7096);
    margin: 0 0 28px;
}

.bankid-hero-media {
    width: 260px;
}

.bankid-hero-media img {
    width: 100%;
    height: auto;
    display: block;
}

/* Restyle the shared login widget (templates/login-form.php) to sit inline
   in the hero instead of as its own centered white card. Scoped to this
   wrapper only — the card look stays everywhere else the widget renders
   (checkout, WooCommerce account). */
.bankid-hero-cta .bankid-login-container {
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.bankid-hero-cta .bankid-button {
    width: auto !important;
    max-width: none !important;
    background: var(--svea-navy, #0E3A5C) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
}

.bankid-hero-cta .bankid-button:hover,
.bankid-hero-cta .bankid-button:active {
    background: #0a2c47 !important;
}

.bankid-hero-cta .bankid-security-info {
    justify-content: flex-start;
}

/* The QR/status result (.bankid-result, from templates/login-form.php)
   pops up centered over a dimmed backdrop instead of pushing the hero's
   own content down the page. Both are position:fixed at all times and
   just faded/scaled in via .bankid-popup-open on the ancestor, so they
   never affect layout — .bankid-login-container's own box-sizing:border-
   box reset already applies here too. */
.bankid-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14, 58, 92, 0.55);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.bankid-hero-cta.bankid-popup-open .bankid-popup-backdrop {
    opacity: 1;
    visibility: visible;
}

.bankid-hero-cta .bankid-result {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1001;
    width: calc(100% - 40px);
    max-width: 380px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--svea-card-bg, #fff);
    border-radius: var(--svea-radius, 16px);
    padding: 36px 28px 28px;
    box-shadow: 0 20px 60px rgba(14, 58, 92, 0.35);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.bankid-hero-cta.bankid-popup-open .bankid-result {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.bankid-hero-cta .bankid-result-close {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--svea-blue-pale, #E5F7FF);
    color: var(--svea-navy, #0E3A5C);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.bankid-hero-cta .bankid-result-close:hover {
    background: var(--svea-card-border, rgba(14, 58, 92, 0.1));
}

/* ── Feature list ─────────────────────────────────────────────────────── */

.bankid-features-title,
.bankid-faq-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--svea-navy, #0E3A5C);
    margin: 0 0 8px;
}

.bankid-features-subtitle,
.bankid-faq-subtitle {
    font-size: 14px;
    color: var(--svea-muted, #5B7096);
    margin: 0 0 24px;
    max-width: 560px;
}

.bankid-feature-list {
    background: var(--svea-card-bg, #fff);
    border: 1px solid var(--svea-card-bg, #fff);
    border-radius: var(--svea-radius, 16px);
    box-shadow: 0 4px 14px rgba(14, 58, 92, 0.05);
    padding: 8px 28px;
}

.bankid-feature-row {
    padding: 18px 0;
    border-top: 1px solid var(--svea-card-border, rgba(14, 58, 92, 0.1));
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bankid-feature-row:first-child { border-top: none; }

.bankid-feature-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--svea-navy, #0E3A5C);
}

.bankid-feature-desc {
    font-size: 14px;
    color: var(--svea-muted, #5B7096);
}

/* ── Articles (blog posts / pages) ────────────────────────────────────── */

.bankid-articles { margin-top: 48px; }

.bankid-articles-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--svea-navy, #0E3A5C);
    margin: 0 0 8px;
}

.bankid-articles-subtitle {
    font-size: 14px;
    color: var(--svea-muted, #5B7096);
    margin: 0 0 24px;
    max-width: 560px;
}

.bankid-article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.bankid-article-card {
    display: flex;
    flex-direction: column;
    background: var(--svea-card-bg, #fff);
    border-radius: var(--svea-radius, 16px);
    box-shadow: 0 4px 14px rgba(14, 58, 92, 0.08);
    overflow: hidden;
}

/* Fixed 16:10 box whatever the source image's proportions. The image is
   taken out of the flow (absolute) so it can't stretch the box, and cropped
   to fill it with object-fit. !important because theme/Elementor img rules
   (height:auto, max-width:100%) otherwise win and leave a gap. */
.bankid-article-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--svea-blue-pale, #E5F7FF);
}

.bankid-article-media img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    display: block;
}

.bankid-article-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 20px 22px;
}

/* Scoped under .bankid-landing so these beat the theme/Elementor kit's own
   h3 and link styles (e.g. ".elementor-kit-N h3"), which otherwise make the
   card titles huge and the link the theme's blue. */
.bankid-landing .bankid-article-title {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
    color: var(--svea-navy, #0E3A5C);
    margin: 0 0 8px;
    padding: 0;
}

.bankid-article-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--svea-muted, #5B7096);
    margin: 0 0 16px;
}

.bankid-landing .bankid-article-link,
.bankid-landing .bankid-article-link:visited {
    margin-top: auto;
    align-self: flex-start;
    font-size: 14px;
    font-weight: 600;
    color: var(--svea-navy, #0E3A5C);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--svea-navy, #0E3A5C);
}

.bankid-landing .bankid-article-link:hover,
.bankid-landing .bankid-article-link:focus {
    color: var(--svea-accent, #F5B400);
    text-decoration: none;
    border-bottom-color: var(--svea-accent, #F5B400);
}

/* ── FAQ ──────────────────────────────────────────────────────────────── */

.bankid-faq { margin-top: 48px; }

.bankid-faq-list {
    background: var(--svea-card-bg, #fff);
    border: 1px solid var(--svea-card-bg, #fff);
    border-radius: var(--svea-radius, 16px);
    box-shadow: 0 4px 14px rgba(14, 58, 92, 0.05);
    padding: 4px 28px;
}

.bankid-faq-item {
    border-top: 1px solid var(--svea-card-border, rgba(14, 58, 92, 0.1));
    padding: 16px 0;
}

.bankid-faq-item:first-child { border-top: none; }

.bankid-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--svea-navy, #0E3A5C);
    cursor: pointer;
    list-style: none;
}

.bankid-faq-question::-webkit-details-marker { display: none; }

.bankid-faq-chevron {
    flex-shrink: 0;
    color: var(--svea-muted, #5B7096);
    transition: transform 0.15s ease, color 0.15s ease;
}

.bankid-faq-item[open] .bankid-faq-chevron {
    transform: rotate(90deg);
    color: var(--svea-accent, #F5B400);
}

.bankid-faq-answer {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--svea-muted, #5B7096);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .bankid-landing { padding: 32px 24px; }

    .bankid-hero { flex-direction: column; gap: 24px; }
    .bankid-hero-text { max-width: none; }
    .bankid-hero-media { width: 200px; align-self: center; }
    .bankid-hero-title { font-size: 30px; }

    .bankid-features-title,
    .bankid-articles-title,
    .bankid-faq-title { font-size: 22px; }

    .bankid-article-grid { grid-template-columns: 1fr; }

    .bankid-feature-list,
    .bankid-faq-list { padding: 4px 18px; }
}

@media (max-width: 480px) {
    .bankid-landing { padding: 24px 16px; }
    .bankid-hero-title { font-size: 26px; }
}
