/**
 * ecom_testmail — Analizador de entregabilidad de correo (clon de mail-tester)
 *
 * @author    Ecom Experts
 * @copyright 2026 Ecom Experts
 * @license   AFL-3.0
 */

:root {
    --bg: #f4f6fb;
    --bg-soft: #ffffff;
    --bg-code: #f1f3f9;
    --ink: #16202f;
    --ink-soft: #5a6a80;
    --ink-faint: #8b98ab;
    --line: #e2e7f0;
    --line-strong: #cbd4e2;
    --brand: #2f6df6;
    --brand-dark: #1f52c9;
    --brand-soft: #e8effe;
    --ok: #12996b;
    --ok-soft: #e2f6ee;
    --warn: #c8820a;
    --warn-soft: #fdf3de;
    --bad: #d63b3b;
    --bad-soft: #fdeaea;
    --shadow: 0 1px 2px rgba(16, 32, 60, .06), 0 8px 24px rgba(16, 32, 60, .06);
    --radius: 14px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1420;
        --bg-soft: #161e2c;
        --bg-code: #1c2536;
        --ink: #e8edf6;
        --ink-soft: #9fb0c7;
        --ink-faint: #71829a;
        --line: #253044;
        --line-strong: #33415a;
        --brand: #5b8dff;
        --brand-dark: #7ba4ff;
        --brand-soft: #1a2743;
        --ok: #3ecf98;
        --ok-soft: #122c25;
        --warn: #e5a93a;
        --warn-soft: #2e2617;
        --bad: #f2706e;
        --bad-soft: #33191b;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
    color: var(--brand);
}

.wrap {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 20px;
}

.wrap-wide {
    max-width: 1120px;
}

/* ---------------------------------------------------------------- cabecera */

.site-head {
    padding: 26px 0;
}

.site-head .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -.01em;
}

.logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), #7f5bff);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 15px;
}

.site-head nav {
    display: flex;
    gap: 18px;
    font-size: 14px;
}

.site-head nav a {
    color: var(--ink-soft);
    text-decoration: none;
}

.site-head nav a:hover {
    color: var(--brand);
}

/* ------------------------------------------------------------------- inicio */

.hero {
    text-align: center;
    padding: 14px 0 30px;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.15;
    letter-spacing: -.025em;
    margin: 0 0 12px;
}

.hero p {
    color: var(--ink-soft);
    font-size: 17px;
    max-width: 620px;
    margin: 0 auto;
}

.card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 20px;
}

.card > h2 {
    margin: 0 0 6px;
    font-size: 19px;
    letter-spacing: -.01em;
}

.card > h2 + p {
    margin-top: 0;
    color: var(--ink-soft);
    font-size: 15px;
}

.steps {
    display: grid;
    gap: 18px;
}

.step {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 16px;
    align-items: start;
}

.step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.step h3 {
    margin: 4px 0 8px;
    font-size: 16px;
}

.address-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--bg-code);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    padding: 14px 16px;
}

.address {
    font-family: var(--mono);
    font-size: clamp(15px, 2.6vw, 21px);
    font-weight: 600;
    letter-spacing: -.01em;
    word-break: break-all;
    flex: 1 1 260px;
    color: var(--ink);
    background: none;
    border: 0;
    padding: 0;
    min-width: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 18px;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-primary[disabled] {
    opacity: .55;
    cursor: default;
}

.btn-ghost {
    background: var(--bg-soft);
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 15px 26px;
    font-size: 17px;
}

.waiting {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 15px;
    margin-top: 14px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hint {
    font-size: 14px;
    color: var(--ink-faint);
    margin: 10px 0 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-top: 6px;
}

.feature {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    font-size: 14.5px;
    color: var(--ink-soft);
}

.feature b {
    display: block;
    color: var(--ink);
    font-size: 15px;
    margin-bottom: 2px;
}

.feature-icon {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--brand);
    margin-top: 1px;
}

/* ------------------------------------------------------------------ informe */

.score-head {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 28px;
    align-items: center;
}

@media (max-width: 620px) {
    .score-head {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

.gauge {
    position: relative;
    width: 168px;
    height: 168px;
}

.gauge svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-track {
    fill: none;
    stroke: var(--line);
    stroke-width: 12;
}

.gauge-value {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset .9s cubic-bezier(.2, .8, .2, 1);
}

.gauge-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
}

.gauge-label b {
    display: block;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -.04em;
}

.gauge-label span {
    font-size: 14px;
    color: var(--ink-faint);
}

.score-head h1 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -.02em;
}

.score-head p {
    margin: 0 0 14px;
    color: var(--ink-soft);
}

.meta-line {
    font-size: 14px;
    color: var(--ink-faint);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.meta-line strong {
    color: var(--ink-soft);
    font-weight: 600;
}

.blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.block {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 13px 15px;
    background: var(--bg);
}

.block span {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

.block b {
    font-size: 19px;
    letter-spacing: -.02em;
}

.block.is-ok b {
    color: var(--ok);
}

.block.is-warn b {
    color: var(--warn);
}

.block.is-bad b {
    color: var(--bad);
}

/* secciones */

section.panel {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.01em;
    flex: 1;
}

.panel-body {
    padding: 18px 22px 22px;
}

.panel-body > :first-child {
    margin-top: 0;
}

.panel-body > :last-child {
    margin-bottom: 0;
}

.pill {
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: .01em;
}

.pill-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.pill-warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.pill-bad {
    background: var(--bad-soft);
    color: var(--bad);
}

.pill-info {
    background: var(--brand-soft);
    color: var(--brand);
}

/* lista de comprobaciones */

.checks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checks > li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.checks > li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.checks > li:first-child {
    padding-top: 0;
}

.check-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex: none;
    margin-top: 1px;
}

.is-ok .check-icon {
    background: var(--ok-soft);
    color: var(--ok);
}

.is-warning .check-icon {
    background: var(--warn-soft);
    color: var(--warn);
}

.is-error .check-icon {
    background: var(--bad-soft);
    color: var(--bad);
}

.is-info .check-icon {
    background: var(--brand-soft);
    color: var(--brand);
}

.check-title {
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.check-cost {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--bad);
    background: var(--bad-soft);
    padding: 1px 8px;
    border-radius: 999px;
}

.check-detail {
    color: var(--ink-soft);
    font-size: 14.5px;
    margin-top: 4px;
}

/* tablas */

.table-scroll {
    overflow-x: auto;
    margin: 0 -22px;
    padding: 0 22px;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    min-width: 480px;
}

table.data th {
    text-align: left;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-faint);
    font-weight: 700;
    padding: 0 12px 8px 0;
    border-bottom: 1px solid var(--line);
}

table.data td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

table.data tr:last-child td {
    border-bottom: 0;
}

table.data td.num {
    font-family: var(--mono);
    font-weight: 600;
    white-space: nowrap;
}

td.num.plus {
    color: var(--bad);
}

td.num.minus {
    color: var(--ok);
}

code, pre {
    font-family: var(--mono);
    font-size: 13.5px;
}

code {
    background: var(--bg-code);
    border-radius: 6px;
    padding: 2px 6px;
    word-break: break-all;
}

pre {
    background: var(--bg-code);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 12px 0;
    line-height: 1.5;
}

.dl {
    display: grid;
    grid-template-columns: minmax(150px, auto) 1fr;
    gap: 8px 20px;
    font-size: 14.5px;
    margin: 0;
}

.dl dt {
    color: var(--ink-soft);
}

.dl dd {
    margin: 0;
    word-break: break-word;
}

@media (max-width: 560px) {
    .dl {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .dl dd {
        margin-bottom: 10px;
    }
}

details.raw {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: 14px;
}

details.raw > summary {
    cursor: pointer;
    color: var(--brand);
    font-size: 14.5px;
    font-weight: 600;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0 26px;
}

.notice {
    border-radius: 11px;
    padding: 14px 16px;
    font-size: 14.5px;
    margin: 0 0 16px;
    border: 1px solid;
}

.notice-warn {
    background: var(--warn-soft);
    border-color: rgba(200, 130, 10, .3);
    color: var(--warn);
}

.notice-bad {
    background: var(--bad-soft);
    border-color: rgba(214, 59, 59, .3);
    color: var(--bad);
}

.notice-info {
    background: var(--brand-soft);
    border-color: rgba(47, 109, 246, .25);
    color: var(--brand);
}

.preview-frame {
    width: 100%;
    height: 420px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.site-foot {
    text-align: center;
    color: var(--ink-faint);
    font-size: 13.5px;
    padding: 30px 0 40px;
}

.site-foot a {
    color: var(--ink-soft);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: var(--bg-soft);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 50;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.history {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14.5px;
}

.history li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.history li:last-child {
    border-bottom: 0;
}

.history .h-score {
    font-weight: 700;
    font-family: var(--mono);
}

@media print {
    .site-head nav,
    .actions,
    .btn {
        display: none !important;
    }

    body {
        background: #fff;
    }

    section.panel {
        break-inside: avoid;
        box-shadow: none;
    }
}
