/* ============================================================
   VulWall — /cert page styles
   Reuses CSS variables from site.css (loaded globally).
   ============================================================ */

/* ==============================
   Page wrapper
   ============================== */
.cert-page {
    background: var(--brand-off-white);
}

/* ==============================
   Shared section scaffolding
   ============================== */
.cert-section {
    padding: var(--space-20) var(--space-5);
}

.cert-section--white {
    background: #ffffff;
}

.cert-section--blue {
    background: var(--brand-primary-gradient);
    color: #ffffff;
}

.cert-section--bordered-top {
    border-top: 1px solid var(--gray-200);
}

.cert-container {
    max-width: 1100px;
    margin: 0 auto;
}

.cert-container--narrow {
    max-width: 760px;
    margin: 0 auto;
}

/* ==============================
   Section headings
   ============================== */
.cert-eyebrow {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: var(--space-3);
}

.cert-eyebrow--dark {
    color: var(--brand-blue);
}

.cert-section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.cert-section-header--light .cert-section-title,
.cert-section-header--light .cert-section-subtitle {
    color: #ffffff;
}

.cert-section-header--light .cert-section-subtitle {
    opacity: 0.85;
}

.cert-section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: var(--font-weight-bold);
    color: var(--brand-dark-blue);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
}

.cert-section-title--left {
    text-align: left;
}

.cert-section-subtitle {
    font-size: var(--text-lg);
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
    max-width: 640px;
    margin: 0 auto;
}

/* ==============================
   Hero
   ============================== */
.cert-hero {
    background: var(--brand-primary-gradient);
    padding: var(--space-20) var(--space-5) var(--space-16);
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

/* Subtle grid texture */
.cert-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.cert-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-12);
    align-items: center;
}

.cert-hero-text {
    max-width: 600px;
}

.cert-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: var(--font-weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.025em;
    margin-bottom: var(--space-5);
    color: #ffffff;
}

.cert-hero-subtitle {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    opacity: 0.9;
    margin-bottom: var(--space-8);
    color: #ffffff;
}

.cert-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.cert-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cert-hero-visual {
    flex-shrink: 0;
}

.cert-hero-image {
    width: 360px;
    max-width: 100%;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--glass-border);
}

/* ==============================
   Scan category grid (Section 2)
   ============================== */
.cert-scan-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
}

.cert-scan-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: transform var(--duration-200) var(--ease-out),
                box-shadow var(--duration-200) var(--ease-out);
}

.cert-scan-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.cert-scan-icon {
    width: 44px;
    height: 44px;
    background: rgba(0, 86, 161, 0.08);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    color: var(--brand-blue);
    font-size: 1.25rem;
    transition: background var(--duration-200) var(--ease-out);
}

.cert-scan-card:hover .cert-scan-icon {
    background: rgba(0, 86, 161, 0.14);
}

.cert-scan-title {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    color: var(--brand-dark-blue);
    margin-bottom: var(--space-2);
}

.cert-scan-desc {
    font-size: var(--text-sm);
    color: var(--gray-500);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* ==============================
   Score tiers (Section 3)
   ============================== */
.cert-score-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 760px;
    margin: 0 auto;
}

.cert-score-card {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-xl);
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform var(--duration-200) var(--ease-out),
                background var(--duration-200) var(--ease-out);
}

.cert-score-card:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.15);
}

.cert-score-indicator {
    width: 6px;
    flex-shrink: 0;
}

.cert-score-body {
    display: grid;
    grid-template-columns: 90px 150px 1fr;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-6);
}

.cert-score-range {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cert-score-label {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

/* Score tier colors */
.cert-score-card[data-tier="excellent"] .cert-score-indicator { background: #10b981; }
.cert-score-card[data-tier="excellent"] .cert-score-label { color: #34d399; }

.cert-score-card[data-tier="good"] .cert-score-indicator { background: #3b82f6; }
.cert-score-card[data-tier="good"] .cert-score-label { color: var(--brand-blue-light); }

.cert-score-card[data-tier="attention"] .cert-score-indicator { background: #f59e0b; }
.cert-score-card[data-tier="attention"] .cert-score-label { color: #fbbf24; }

.cert-score-card[data-tier="poor"] .cert-score-indicator { background: #f97316; }
.cert-score-card[data-tier="poor"] .cert-score-label { color: #fb923c; }

.cert-score-card[data-tier="critical"] .cert-score-indicator { background: #ef4444; }
.cert-score-card[data-tier="critical"] .cert-score-label { color: #f87171; }

.cert-score-desc {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.8);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* ==============================
   Certificate element list (Section 4)
   ============================== */
.cert-elements-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    max-width: 820px;
    margin: 0 auto;
}

.cert-element {
    display: flex;
    gap: var(--space-5);
    padding: var(--space-6);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    transition: box-shadow var(--duration-200) var(--ease-out);
}

.cert-element:hover {
    box-shadow: var(--shadow-sm);
}

.cert-element-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(33, 44, 94, 0.07);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-dark-blue);
    font-size: 1.125rem;
    margin-top: 2px;
}

.cert-element-title {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    color: var(--brand-dark-blue);
    margin-bottom: var(--space-2);
}

.cert-element-desc {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* ==============================
   Always Current (Section 5)
   ============================== */
.cert-current-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.cert-lead {
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--gray-700);
    margin-bottom: var(--space-6);
    padding-left: var(--space-4);
    border-left: 3px solid var(--brand-blue);
}

.cert-current-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.cert-current-item {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    font-size: var(--text-base);
    color: var(--gray-700);
    line-height: var(--leading-relaxed);
}

.cert-current-item i {
    color: var(--brand-blue);
    font-size: 1.125rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Mini assessment timeline card */
.cert-timeline-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-brand);
}

.cert-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.cert-timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    background: var(--color-success);
}

.cert-timeline-dot--pulse {
    background: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(0, 86, 161, 0.15);
    animation: certPulse 2.5s ease-in-out infinite;
}

.cert-timeline-connector {
    width: 2px;
    height: var(--space-8);
    background: var(--gray-200);
    margin: var(--space-2) 0 var(--space-2) 6px;
}

.cert-timeline-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--brand-dark-blue);
}

.cert-timeline-note {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

.cert-timeline-note--active {
    color: var(--brand-blue);
    font-weight: var(--font-weight-medium);
}

@keyframes certPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 86, 161, 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(0, 86, 161, 0.05); }
}

/* ==============================
   FAQ (Section 6)
   ============================== */
.cert-faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cert-faq-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: box-shadow var(--duration-200) var(--ease-out);
}

.cert-faq-item[open] {
    box-shadow: var(--shadow-sm);
}

.cert-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    color: var(--brand-dark-blue);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background var(--duration-150) var(--ease-out);
}

.cert-faq-question::-webkit-details-marker { display: none; }

.cert-faq-question:hover {
    background: var(--gray-100);
}

.cert-faq-chevron {
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--gray-500);
    transition: transform var(--duration-200) var(--ease-out);
}

.cert-faq-item[open] .cert-faq-chevron {
    transform: rotate(180deg);
}

.cert-faq-answer {
    padding: 0 var(--space-6) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cert-faq-answer p {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* ==============================
   CTA (Section 7)
   ============================== */
.cert-cta-section {
    text-align: center;
}

.cert-cta-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: var(--font-weight-bold);
    color: #ffffff;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
}

.cert-cta-subtitle {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.85);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
}

.cert-cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.cert-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3-5) var(--space-8);
    background: #ffffff;
    color: var(--brand-dark-blue);
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: transform var(--duration-200) var(--ease-out),
                box-shadow var(--duration-200) var(--ease-out);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.cert-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.28);
    color: var(--brand-dark-blue);
    text-decoration: none;
}

.cert-cta-secondary {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    transition: color var(--duration-200) var(--ease-out),
                text-decoration-color var(--duration-200) var(--ease-out);
}

.cert-cta-secondary:hover {
    color: #ffffff;
    text-decoration-color: rgba(255, 255, 255, 0.9);
}

.cert-cta-note {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* ======================================================
   Dark Theme
   ====================================================== */
html[data-bs-theme="dark"] .cert-page {
    background: var(--bg-primary);
}

/* White sections become dark surfaces */
html[data-bs-theme="dark"] .cert-section--white {
    background: var(--bg-primary);
}

html[data-bs-theme="dark"] .cert-section--bordered-top {
    border-top-color: var(--border-color);
}

/* Section title and subtitle */
html[data-bs-theme="dark"] .cert-section-title {
    color: var(--text-primary);
}

html[data-bs-theme="dark"] .cert-section-subtitle {
    color: var(--text-secondary);
}

html[data-bs-theme="dark"] .cert-eyebrow--dark {
    color: var(--brand-blue-light);
}

/* Scan cards */
html[data-bs-theme="dark"] .cert-scan-card {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .cert-scan-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

html[data-bs-theme="dark"] .cert-scan-icon {
    background: rgba(96, 165, 250, 0.1);
    color: var(--brand-blue-light);
}

html[data-bs-theme="dark"] .cert-scan-card:hover .cert-scan-icon {
    background: rgba(96, 165, 250, 0.18);
}

html[data-bs-theme="dark"] .cert-scan-title {
    color: var(--text-primary);
}

html[data-bs-theme="dark"] .cert-scan-desc {
    color: var(--text-secondary);
}

/* Certificate element list */
html[data-bs-theme="dark"] .cert-element {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .cert-element:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

html[data-bs-theme="dark"] .cert-element-icon {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

html[data-bs-theme="dark"] .cert-element-title {
    color: var(--text-primary);
}

html[data-bs-theme="dark"] .cert-element-desc {
    color: var(--text-secondary);
}

/* Always current */
html[data-bs-theme="dark"] .cert-lead {
    color: var(--text-tertiary);
    border-left-color: var(--brand-blue-light);
}

html[data-bs-theme="dark"] .cert-current-item {
    color: var(--text-tertiary);
}

html[data-bs-theme="dark"] .cert-current-item i {
    color: var(--brand-blue-light);
}

html[data-bs-theme="dark"] .cert-timeline-card {
    background: var(--bg-surface);
    border-color: var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html[data-bs-theme="dark"] .cert-timeline-connector {
    background: var(--border-color);
}

html[data-bs-theme="dark"] .cert-timeline-label {
    color: var(--text-primary);
}

html[data-bs-theme="dark"] .cert-timeline-note {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .cert-timeline-note--active {
    color: var(--brand-blue-light);
}

/* FAQ */
html[data-bs-theme="dark"] .cert-faq-item {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .cert-faq-item[open] {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

html[data-bs-theme="dark"] .cert-faq-question {
    color: var(--text-primary);
}

html[data-bs-theme="dark"] .cert-faq-question:hover {
    background: var(--bg-surface-hover);
}

html[data-bs-theme="dark"] .cert-faq-chevron {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .cert-faq-answer p {
    color: var(--text-secondary);
}

/* ======================================================
   Responsive: 900px
   ====================================================== */
@media (max-width: 900px) {
    .cert-hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cert-hero-badges {
        justify-content: center;
    }

    .cert-hero-visual {
        display: none;
    }

    .cert-scan-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cert-score-body {
        grid-template-columns: 80px 130px 1fr;
        gap: var(--space-4);
    }

    .cert-current-wrapper {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }
}

/* ======================================================
   Responsive: 768px (tablet)
   ====================================================== */
@media (max-width: 768px) {
    .cert-section {
        padding: var(--space-14) var(--space-5);
    }

    .cert-scan-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cert-score-body {
        grid-template-columns: 1fr;
        gap: var(--space-1);
        padding: var(--space-4) var(--space-5);
    }

    .cert-score-range {
        font-size: var(--text-lg);
    }

    .cert-score-label {
        font-size: var(--text-sm);
    }

    .cert-elements-list {
        gap: var(--space-2);
    }

    .cert-element {
        padding: var(--space-5);
    }

    .cert-cta-actions {
        flex-direction: column;
        gap: var(--space-3);
    }
}

/* ======================================================
   Responsive: 640px (mobile)
   ====================================================== */
@media (max-width: 640px) {
    .cert-hero {
        padding: var(--space-14) var(--space-4) var(--space-12);
    }

    .cert-hero-title {
        font-size: var(--text-3xl);
    }

    .cert-hero-subtitle {
        font-size: var(--text-base);
    }

    .cert-hero-badge {
        font-size: var(--text-xs);
        padding: var(--space-1-5) var(--space-3);
    }

    .cert-section {
        padding: var(--space-12) var(--space-4);
    }

    .cert-section-header {
        margin-bottom: var(--space-8);
    }

    .cert-scan-grid {
        grid-template-columns: 1fr;
    }

    .cert-score-card {
        border-radius: var(--radius-lg);
    }

    .cert-element {
        flex-direction: column;
        gap: var(--space-3);
    }

    .cert-element-icon {
        margin-top: 0;
    }

    .cert-faq-question {
        padding: var(--space-4) var(--space-5);
        font-size: var(--text-sm);
    }

    .cert-faq-answer {
        padding: 0 var(--space-5) var(--space-4);
    }

    .cert-cta-primary {
        width: 100%;
        justify-content: center;
    }
}

/* ======================================================
   Reduced Motion
   ====================================================== */
@media (prefers-reduced-motion: reduce) {
    .cert-scan-card,
    .cert-score-card,
    .cert-element,
    .cert-cta-primary,
    .cert-faq-chevron {
        transition: none !important;
    }

    .cert-timeline-dot--pulse {
        animation: none;
        box-shadow: 0 0 0 4px rgba(0, 86, 161, 0.15);
    }
}
