/* ==========================================================================
   SähköAle Sähköyhtiö Vertailu – v2.0 with real logos
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

.sa-vertailu-wrapper {
    --sa-primary: #0d9f6e;
    --sa-primary-dark: #057a55;
    --sa-primary-light: #d1fae5;
    --sa-accent: #f59e0b;
    --sa-card-bg: #ffffff;
    --sa-text: #1e293b;
    --sa-text-light: #64748b;
    --sa-border: #e2e8f0;
    --sa-radius: 16px;
    --sa-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --sa-shadow-hover: 0 8px 30px rgba(13,159,110,0.15), 0 4px 12px rgba(0,0,0,0.06);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: var(--sa-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.sa-vertailu-wrapper *,
.sa-vertailu-wrapper *::before,
.sa-vertailu-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Header ── */
.sa-header {
    text-align: center;
    padding: 2.5rem 1.5rem 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #065f46 0%, #0d9f6e 50%, #10b981 100%);
    border-radius: var(--sa-radius);
    position: relative;
    overflow: hidden;
}
.sa-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}
.sa-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.sa-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
}
.sa-header-icon svg {
    width: 28px;
    height: 28px;
    color: #fef3c7;
    filter: drop-shadow(0 0 6px rgba(245,158,11,0.5));
}
.sa-title {
    font-size: clamp(1.25rem, 4vw, 1.85rem) !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
    letter-spacing: -0.02em;
    position: relative;
    line-height: 1.3 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
    background: none !important;
    border: none !important;
}
.sa-subtitle {
    font-size: clamp(0.82rem, 2.5vw, 0.95rem);
    color: rgba(255,255,255,0.85) !important;
    max-width: 560px;
    margin: 0 auto 1.25rem !important;
    padding: 0 0.5rem !important;
    font-weight: 400;
    line-height: 1.5;
}

/* Trust bar */
.sa-trust-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    position: relative;
}
.sa-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.12);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
}
.sa-trust-item svg {
    flex-shrink: 0;
    color: #fef3c7;
}

/* ── Cards Grid ── */
.sa-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Card ── */
.sa-card {
    background: var(--sa-card-bg);
    border-radius: var(--sa-radius);
    padding: 1.5rem;
    box-shadow: var(--sa-shadow);
    border: 1px solid var(--sa-border);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
    animation: sa-fadeUp 0.5s ease-out both;
    overflow: hidden;
}
.sa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-color), var(--brand-color2));
    border-radius: var(--sa-radius) var(--sa-radius) 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sa-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sa-shadow-hover);
}
.sa-card:hover::before {
    opacity: 1;
}

/* Featured */
.sa-card-featured {
    border: 2px solid var(--sa-primary);
    background: linear-gradient(135deg, rgba(13,159,110,0.03) 0%, rgba(16,185,129,0.02) 100%);
}
.sa-card-featured::before {
    opacity: 1;
    height: 5px;
}
.sa-card-featured::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at top right, rgba(13,159,110,0.06) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes sa-fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Rank */
.sa-card-rank {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sa-text-light);
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}
.sa-card-featured .sa-card-rank {
    background: var(--sa-primary-light);
    color: var(--sa-primary-dark);
}

/* Badge */
.sa-badge {
    position: absolute;
    top: 1rem;
    left: 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffffff;
    background: linear-gradient(135deg, var(--sa-primary), var(--sa-primary-dark));
    padding: 4px 12px;
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(13,159,110,0.3);
    z-index: 2;
}

/* Card top */
.sa-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    margin-top: 0.25rem;
}

/* Real logo image */
.sa-logo-wrap {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 2px solid #f1f5f9;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sa-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    display: block;
}
.sa-card:hover .sa-logo-wrap {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.sa-company-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sa-text);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* Stars */
.sa-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
}
.sa-star {
    width: 16px;
    height: 16px;
    color: var(--sa-accent);
}
.sa-rating-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sa-text-light);
    margin-left: 6px;
}

/* Description */
.sa-card-desc {
    font-size: 0.9rem;
    color: var(--sa-text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Pricing Section */
.sa-card-pricing {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #d1fae5;
    border-radius: 12px;
    padding: 0.7rem 0.25rem;
    margin-bottom: 1rem;
    text-align: center;
    overflow: hidden;
}
.sa-price-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 0 0.3rem;
    min-width: 0;
}
.sa-price-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #065f46;
    letter-spacing: -0.03em;
    line-height: 1.2;
    white-space: nowrap;
}
.sa-price-unit {
    font-size: 0.58rem;
    font-weight: 600;
    color: #059669;
}
.sa-price-label {
    font-size: 0.56rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.15;
}
.sa-price-divider {
    width: 1px;
    background: #a7f3d0;
    flex-shrink: 0;
}

/* Details */
.sa-card-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.15rem;
    border: 1px solid #f1f5f9;
}
.sa-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
}
.sa-detail-row + .sa-detail-row {
    border-top: 1px solid #e8ecf1;
    margin-top: 0.3rem;
    padding-top: 0.5rem;
}
.sa-detail-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sa-text-light);
    white-space: nowrap;
}
.sa-detail-label svg {
    color: var(--sa-primary);
    flex-shrink: 0;
}
.sa-detail-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sa-text);
    text-align: right;
}

/* CTA Button */
.sa-vertailu-wrapper .sa-card .sa-cta-button,
.sa-vertailu-wrapper .sa-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff !important;
    background: #0d9f6e !important;
    background: linear-gradient(135deg, #057a55, #0d9f6e) !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 0 4px 14px rgba(13,159,110,0.3);
    position: relative;
    overflow: hidden;
}
.sa-cta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sa-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    text-decoration: none !important;
    color: #ffffff !important;
}
.sa-cta-button:hover::before {
    opacity: 1;
}
.sa-cta-button svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.sa-cta-button:hover svg {
    transform: translateX(4px);
}

/* Featured CTA */
.sa-card-featured .sa-cta-button {
    background: linear-gradient(135deg, var(--sa-primary-dark), var(--sa-primary));
    box-shadow: 0 4px 14px rgba(13,159,110,0.3);
    padding: 16px 24px;
    font-size: 1rem;
}
.sa-card-featured .sa-cta-button:hover {
    box-shadow: 0 8px 24px rgba(13,159,110,0.4);
}

/* ── Footer ── */
.sa-footer {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--sa-border);
}
.sa-footer-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--sa-text-light);
    line-height: 1.5;
    margin: 0 !important;
}
.sa-footer-text svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--sa-text-light);
}

/* ── Responsive ── */
@media (min-width: 768px) {
    .sa-cards-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .sa-card-featured {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto auto;
        column-gap: 1.5rem;
        padding: 2rem;
        align-items: start;
    }
    .sa-card-featured .sa-card-rank { top: 1.5rem; right: 1.5rem; }
    .sa-card-featured .sa-badge { top: 1.5rem; left: 1.5rem; }
    .sa-card-featured .sa-card-top {
        grid-column: 1 / 2;
        grid-row: 1 / 4;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .sa-card-featured .sa-logo-wrap {
        width: 80px;
        height: 80px;
        min-width: 80px;
        border-radius: 18px;
    }
    .sa-card-featured .sa-card-desc {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        margin-bottom: 0;
        align-self: center;
    }
    .sa-card-featured .sa-card-pricing {
        grid-column: 2 / 4;
        grid-row: 2 / 3;
    }
    .sa-card-featured .sa-card-details {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
        margin-bottom: 0;
    }
    .sa-card-featured .sa-cta-button {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
        align-self: center;
        width: auto;
        min-width: 180px;
        white-space: nowrap;
    }
}

/* Tablet – single column but wider cards */
@media (min-width: 768px) and (max-width: 1024px) {
    .sa-vertailu-wrapper { max-width: 720px; }
    .sa-card-featured .sa-cta-button { min-width: 150px; font-size: 0.9rem; }
}

@media (max-width: 767px) {
    .sa-vertailu-wrapper { padding: 0 0.35rem; margin: 1rem auto; }

    /* Header – compact on mobile */
    .sa-header { padding: 1.5rem 0.85rem 1.25rem; border-radius: 12px; margin-bottom: 1rem; }
    .sa-header-icon { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 0.75rem; }
    .sa-header-icon svg { width: 22px; height: 22px; }

    /* Trust bar – stack nicely */
    .sa-trust-bar { gap: 0.4rem; justify-content: center; }
    .sa-trust-item { font-size: 0.68rem; padding: 4px 8px; gap: 4px; }
    .sa-trust-item svg { width: 13px; height: 13px; }

    /* Cards – full width, tighter */
    .sa-cards-grid { gap: 0.75rem; }
    .sa-card { padding: 1rem; border-radius: 12px; }

    /* Badge + rank – smaller on mobile */
    .sa-badge { font-size: 0.62rem; padding: 3px 8px; top: 0.75rem; left: 0.85rem; }
    .sa-card-rank { width: 30px; height: 30px; font-size: 0.72rem; border-radius: 8px; top: 0.75rem; right: 0.85rem; }

    /* Logo smaller on mobile */
    .sa-logo-wrap { width: 48px; height: 48px; min-width: 48px; border-radius: 12px; }
    .sa-logo-wrap img { padding: 4px; }
    .sa-card-top { gap: 0.75rem; margin-top: 0.15rem; margin-bottom: 0.5rem; }

    /* Company name smaller */
    .sa-company-name { font-size: 1rem; }
    .sa-star { width: 14px; height: 14px; }
    .sa-rating-num { font-size: 0.72rem; }

    /* Description */
    .sa-card-desc { font-size: 0.82rem; margin-bottom: 0.75rem; }

    /* Pricing */
    .sa-card-pricing { padding: 0.5rem 0.15rem; border-radius: 10px; margin-bottom: 0.75rem; }
    .sa-price-value { font-size: 0.9rem; }
    .sa-price-unit { font-size: 0.5rem; }
    .sa-price-label { font-size: 0.5rem; }
    .sa-price-item { padding: 0 0.15rem; }

    /* Details – stack on very small */
    .sa-card-details { padding: 0.65rem 0.75rem; border-radius: 10px; margin-bottom: 0.85rem; }
    .sa-detail-label { font-size: 0.72rem; }
    .sa-detail-value { font-size: 0.78rem; }

    /* CTA button */
    .sa-cta-button { padding: 12px 16px; font-size: 0.88rem; border-radius: 10px; }
    .sa-cta-button svg { width: 16px; height: 16px; }

    /* Footer */
    .sa-footer { padding: 0.75rem 1rem; margin-top: 1rem; border-radius: 10px; }
    .sa-footer-text { font-size: 0.7rem; }
}

/* Extra small phones (< 380px) */
@media (max-width: 380px) {
    .sa-header { padding: 1.25rem 0.65rem 1rem; }
    .sa-trust-bar { flex-direction: column; align-items: center; }
    .sa-card { padding: 0.85rem; }
    .sa-logo-wrap { width: 42px; height: 42px; min-width: 42px; }
    .sa-company-name { font-size: 0.92rem; }
    .sa-detail-row { flex-direction: column; align-items: flex-start; gap: 2px; }
    .sa-detail-value { text-align: left; }
    .sa-card-pricing { flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0.5rem; }
    .sa-price-divider { display: none; }
    .sa-price-item { flex: 0 0 auto; padding: 0 0.4rem; }
    .sa-price-value { font-size: 0.95rem; }
}
