/* =========================================================
   PQC Readiness Scanner — Design tokens
   Light theme defaults; dark overrides in [data-theme="dark"]
   ========================================================= */

:root {
    /* backgrounds */
    --bg-page: #F9F5F1;
    --bg-card: #FFFFFF;
    --bg-inner: #FAFAFA;
    --bg-field: #FFFFFF;
    --bg-field-hover: #F5F5F5;
    --bg-hero: #F9F5F1;

    /* text */
    --text-primary: #111118;
    --text-secondary: #444455;
    --text-tertiary: #737387;
    --text-safe: #14532D;
    --text-danger: #7F1D25;
    --text-medium: #92400E;
    --text-on-accent: #FFFFFF;

    /* brand */
    --accent: #FAA619;
    --accent-hover: #e0940f;
    --accent-bg: #FAA6191A;
    --accent-border: #FAA61961;

    /* safe / danger families */
    --safe: #16A34A;
    --safe-bg: #16A34A17;
    --safe-border: #16A34A47;
    --danger: #DC2626;
    --danger-bg: #DC262617;
    --danger-border: #DC262647;

    /* medium chip + meter */
    --medium-bg: #FAA61924;
    --medium-border: #FAA61959;

    /* lines & shadows */
    --line-subtle: rgba(0, 0, 0, 0.13);
    --line-separator: #EEEEEE;
    --line-heading: #EEEEEE;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Dark theme — tokens only, components never change */
[data-theme="dark"] {
    /* backgrounds */
    --bg-page: #121212;
    --bg-hero: #121212;
    --bg-card: #363031;
    --bg-inner: #2A2627;
    --bg-field: #221F20;
    --bg-field-hover: #3A3435;

    /* text */
    --text-primary: #E0E0E0;
    --text-secondary: #CFC9CB;
    --text-tertiary: #B0B0C0;
    --text-safe: #8CE695;
    --text-danger: #FCA5A5;
    --text-medium: #FCD34D;
    --text-on-accent: #FFFFFF;

    /* brand */
    --accent: #FAA619;
    --accent-hover: #f0b33a;
    --accent-bg: #FAA61926;
    --accent-border: #FAA61961;

    /* safe / danger families */
    --safe: #22C55E;
    --safe-bg: #16A34A26;
    --safe-border: #16A34A59;
    --danger: #EF4444;
    --danger-bg: #DC262626;
    --danger-border: #DC26264D;

    /* medium chip + meter */
    --medium-bg: #FAA6192E;
    --medium-border: #FAA61973;

    /* lines & shadows */
    --line-subtle: rgba(255, 255, 255, 0.15);
    --line-separator: #4A4445;
    --line-heading: #4A4445;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   Base
   ========================================================= */

@media (max-width: 576px) {
    .pqc-detail-row {
        flex-wrap: wrap;          /* let value drop to its own line */
        gap: 4px 16px;
    }

    .pqc-detail-label {
        width: auto;              /* stop the fixed column on mobile */
        min-width: 140px;
    }

    .pqc-detail-value {
        flex-basis: 100%;         /* value takes full line below label */
        text-align: left;
        word-break: break-all;    /* long hosts/ciphers break anywhere, cleanly */
    }

    /* the dashes+chip row: let it wrap instead of clipping */
    .pqc-risk-dashes {
        margin-left: auto;
    }

    .title-1, .title-2 {
        font-size: 40px;
    }

    .pqc-scan-btn {
        padding: 0 14px;
    }

    .pqc-card, .pqc-panel { padding: 12px; }

    .pqc-contact-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-pqc { padding: 16px; }
}

body {
    background-color: var(--bg-page);
}

.spinner-pqc {
    width: 1.5rem;
    height: 1.5rem;
}

/* ===== Typography (Figma) ===== */

.title-1 {
    font-family: 'Exo 2', sans-serif;
    font-size: 64px;
    line-height: 100%;
    letter-spacing: -1px;
    text-align: center;
}

.title-2 {
    font-family: 'Exo 2', sans-serif;
    font-size: 64px;
    line-height: 100%;
    letter-spacing: -1px;
    text-align: center;
}

.color-sm {
    color: #FAA619;
}

.color-primary {
    color: #111118;
}

.color-secondary {
    color: #444455;
}

.color-tertiary {
    color: #737387;
}

.text-1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 23.1px;
    letter-spacing: 0%;
    text-align: center;
}

/* ===== Page card ===== */

.card-pqc {
    max-width: 760px;
    margin: 0 auto;
    background: var(--bg-hero);
    box-shadow: none !important;
}

/* =========================================================
   Search bar
   ========================================================= */

.pqc-inline-bar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 53px;
    padding: 6px 8px;
    gap: 8px;
    background: var(--bg-field);
    border: none;
    border-radius: 10px;
    box-sizing: border-box;
}

.pqc-input {
    flex: 1;
    height: 100%;
    min-width: 0;
    padding: 0 10px;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-tertiary);
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-field);
    border: none;
    outline: none;
    box-shadow: none;
    line-height: 120%;
}

.pqc-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.pqc-input:not(:placeholder-shown) {
    font-weight: 600;
}

.pqc-url-prefix {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-tertiary);
    padding-left: 10px;
    user-select: none;
    flex-shrink: 0;
}

.pqc-scan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    padding: 0 20px;
    background-color: var(--accent);
    color: var(--text-on-accent);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    white-space: nowrap;
    cursor: pointer;
}

.pqc-scan-btn:hover {
    background-color: var(--accent-hover);
}

.pqc-scan-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.pqc-try-hint {
    margin-top: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 120%;
    color: var(--text-tertiary);
    text-align: center;
}

.pqc-try-domain {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--line-subtle);
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-tertiary);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 150ms ease;
}

.pqc-try-domain:hover {
    background: var(--bg-field-hover);
}

.pqc-url-prefix {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-tertiary);
    padding-left: 10px;
    user-select: none;
    flex-shrink: 0;
}

/* =========================================================
   Status banners
   ========================================================= */

.pqc-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 120%;
    border-radius: 9px;
    border: 1px solid transparent;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.pqc-banner::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pqc-banner--success {
    background: var(--safe-bg);
    border-color: var(--safe-border);
    color: var(--text-safe);
}

.pqc-banner--success::before { background: var(--safe); }

.pqc-banner--error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--text-danger);
}

.pqc-banner--error::before { background: var(--danger); }

/* =========================================================
   Connection details card
   ========================================================= */

.pqc-details-card {
    background: var(--bg-card);
    border-style: solid;
    border-width: 2.4px 0.8px 0.8px 0.8px;
    border-color: var(--safe);
    border-radius: 9px;
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.pqc-details-card.is-danger {
    border-color: var(--danger);
}

.pqc-section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 17.6px;
    letter-spacing: 1.43px;
    text-transform: uppercase;
    color: var(--safe);
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-heading);
}

.pqc-details-card.is-danger .pqc-section-title {
    color: var(--danger);
}

/* =========================================================
   Detail rows (label/value table)
   ========================================================= */

.pqc-detail-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-separator);
}

.pqc-detail-row:last-child {
    border-bottom: none;
}

.pqc-detail-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 20.8px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    width: 190px;
}

.pqc-detail-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 15px;
    line-height: 22.5px;
    color: var(--text-primary);
    text-align: left;
    flex: 1;
    min-width: 0;
}

/* =========================================================
   Risk chips + dash meter
   ========================================================= */

.pqc-chip {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 19.2px;
    letter-spacing: 0.84px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.pqc-chip--medium {
    background: var(--medium-bg);
    border-color: var(--medium-border);
    color: var(--text-medium);
}

.pqc-chip--high {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--text-danger);
}

.pqc-risk-dashes {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pqc-risk-dash {
    width: 5px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
    flex: none;
}

.pqc-risk-dashes[data-level="medium"] .pqc-risk-dash:nth-child(n+4) {
    background: var(--bg-card);
    border: 1px solid var(--medium-border);
}

.pqc-risk-dashes[data-level="high"] .pqc-risk-dash {
    background: var(--danger);
}

/* =========================================================
   Shared panels (chart, certificate details, error)
   ========================================================= */

.pqc-panel {
    background: var(--bg-card);
    border-style: solid;
    border-width: 2.4px 0.8px 0.8px 0.8px;
    border-color: var(--accent);
    border-radius: 9px;
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.pqc-panel.is-danger {
    border-color: var(--danger);
}

.pqc-panel-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 17.6px;
    letter-spacing: 1.43px;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 8px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-heading);
}

.pqc-chart-holder {
    height: 240px;
    position: relative;
}

/* =========================================================
   Recommendations
   ========================================================= */

.pqc-recom-inner {
    background: var(--bg-inner);
    border: 1px solid var(--line-subtle);
    border-radius: 7px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 26.25px;
    color: var(--text-secondary);
}

.pqc-contact-bar {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    padding: 14px 16px;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 24px;
    color: var(--text-secondary);
}

.pqc-contact-bar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 22.4px;
    color: var(--accent);
    text-decoration: none;
}

.pqc-contact-bar a:hover {
    text-decoration: underline;
}

.spinner-pqc { width: 1.5rem; height: 1.5rem; }

.title-1 {
    font-family: 'Exo 2', sans-serif;
    font-size: 64px;
    line-height: 100%;
    letter-spacing: -1px;
    text-align: center;
}

.title-2 {
    font-family: 'Exo 2', sans-serif;
    font-size: 64px;
    line-height: 100%;
    letter-spacing: -1px;
    text-align: center;
}

.color-sm { color: var(--accent); }
.color-primary { color: var(--text-primary); }
.color-secondary { color: var(--text-secondary); }
.color-tertiary { color: var(--text-tertiary); }

.text-1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 23.1px;
    letter-spacing: 0%;
    text-align: center;
}

/* ===== Theme toggle ===== */

.card-pqc {
    position: relative;   /* anchor for the absolutely-positioned toggle */
}

.pqc-theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line-subtle);
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.pqc-theme-toggle:hover {
    background: var(--bg-field-hover);
}

.pqc-theme-toggle .pqc-icon-sun { display: none; }

[data-theme="dark"] .pqc-theme-toggle .pqc-icon-moon { display: none; }
[data-theme="dark"] .pqc-theme-toggle .pqc-icon-sun { display: block; }