/**
 * MailHawk — Production CSS
 * Minimal / Apple-inspired design. Mobile-first.
 * No external fonts, no build step, no framework.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ─────────────────────────────────────────── */
:root {
    --bg:        #f0f0f5;
    --bg-off:    #e8e8ed;
    --bg-subtle: #f5f5f8;
    --border:    #d8d8de;
    --text:      #1d1d1f;
    --text-mid:  #424245;
    --text-soft: #86868b;

    --green:     #34c759;
    --red:       #ff3b30;
    --amber:     #ff9f0a;
    --blue:      #0071e3;

    --radius:    14px;
    --radius-sm: 10px;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
}


/* ── Base ──────────────────────────────────────────────── */
html {
    font-size: 16px;
    overflow-x: hidden; /* prevent horizontal scroll/swipe */
}
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior-x: none;
}

/* ── Header ────────────────────────────────────────────── */
header {
    border-bottom: 1px solid var(--border);
    background: rgba(240,240,245,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.2s, border-color 0.2s;
}
.header-inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.logo-icon { font-size: 1.15rem; line-height: 1; }
.logo span  { color: var(--blue); }

nav { display: flex; gap: 0; }
nav a {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
}
nav a:hover  { color: var(--text); background: var(--bg-off); }
nav a.active { color: var(--blue); }

/* ── Page layout ───────────────────────────────────────── */
.main-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.25rem 8rem;
}

/* ── Segment control (tabs) ────────────────────────────── */
.segment-wrap {
    padding: 1rem 0 1rem;
    display: flex;
    justify-content: center;
}
.segment {
    display: inline-flex;
    background: var(--bg-off);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.seg-btn {
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 1.1rem;
    transition: all 0.2s;
    font-family: var(--font);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.seg-btn.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.06);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Steps (how it works) ──────────────────────────────── */
.steps {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 500px) {
    .steps { grid-template-columns: 1fr; }
}
.step {
    background: var(--bg-off);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.step-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}
.step-text strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.step-text {
    font-size: 0.8rem;
    color: var(--text-soft);
    line-height: 1.45;
}

/* ── Generate button area ──────────────────────────────── */
.generate-area {
    text-align: center;
    margin-bottom: 2rem;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-radius: 980px;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.5rem 1.15rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary {
    background: var(--blue);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.7rem 1.75rem;
    letter-spacing: -0.01em;
    width: 100%;
}
@media (min-width: 480px) { .btn-primary { width: auto; } }
.btn-primary:hover  { background: #0077ed; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-outline {
    background: var(--bg-off);
    color: var(--text-mid);
}
.btn-outline:hover { background: var(--border); }

.btn-sm { font-size: 0.82rem; padding: 0.35rem 0.9rem; }

/* ── Address box ───────────────────────────────────────── */
.address-box {
    background: var(--bg-off);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.address-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blue);
    margin-bottom: 0.6rem;
}
.address-value {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--text);
    font-weight: 500;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.9rem;
    word-break: break-all;
    line-height: 1.5;
}
.address-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.address-timer {
    font-size: 0.78rem;
    color: var(--text-soft);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 980px;
    padding: 0.3rem 0.75rem;
}

/* ── Waiting card ──────────────────────────────────────── */
.waiting-card {
    text-align: center;
    padding: 2.5rem 1rem;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 2.5px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.waiting-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.waiting-sub   { font-size: 0.85rem; color: var(--text-soft); }

/* ── Error / alert ─────────────────────────────────────── */
.warning-item {
    background: rgba(255,59,48,0.07);
    border: 1px solid rgba(255,59,48,0.18);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.85rem;
    color: var(--red);
    margin-bottom: 0.75rem;
}

/* ── Score hero (report page) ──────────────────────────── */
.score-hero {
    padding: 2rem 0 1.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.75rem;
}
.score-big {
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.score-big.pass { color: var(--green); }
.score-big.warn { color: var(--amber); }
.score-big.fail { color: var(--red); }
.score-denom {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-soft);
    letter-spacing: -0.02em;
}
.score-verdict {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-mid);
    margin-bottom: 0.4rem;
}
.score-meta { font-size: 0.82rem; color: var(--text-soft); }

/* ── Report bar (report page header row) ───────────────── */
.report-bar {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.report-bar h1 { font-size: 1rem; font-weight: 600; }
.report-bar p  { font-size: 0.82rem; color: var(--text-soft); margin-top: 0.15rem; }

/* ── Issues pill ───────────────────────────────────────── */
.issues-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,59,48,0.08);
    color: var(--red);
    border: 1px solid rgba(255,59,48,0.2);
    border-radius: 980px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1.5rem;
}

/* ── Section label ─────────────────────────────────────── */
.section-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-soft);
    margin: 1.75rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

/* ── Check list ────────────────────────────────────────── */
.check-list { display: flex; flex-direction: column; margin-bottom: 1.5rem; }

/* v3 check rows */
.check-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
    border-radius: 4px;
    min-height: 52px;
}
.check-row:last-of-type { border-bottom: none; }
.check-row:hover {
    background: var(--bg-off);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin: 0 -0.5rem;
}

/* Status dots */
.check-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 2px;
}
.dot-pass  { background: var(--green); }
.dot-fail  { background: var(--red); }
.dot-warn  { background: var(--amber); }
.dot-miss  { background: var(--red); }
.dot-clean { background: var(--green); }
.dot-found { background: var(--blue); }

.check-icon-sm {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.check-label-wrap { flex: 1; min-width: 0; }
.check-name  { font-size: 0.92rem; font-weight: 500; color: var(--text); }
.check-sub   { font-size: 0.78rem; color: var(--text-soft); margin-top: 0.05rem; }

.status-word {
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: capitalize;
}
.sw-pass  { color: var(--green); }
.sw-fail  { color: var(--red); }
.sw-warn  { color: var(--amber); }
.sw-miss  { color: var(--red); }
.sw-clean { color: var(--green); }
.sw-found { color: var(--blue); }

.chev {
    font-size: 0.6rem;
    color: var(--text-soft);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 0.1rem;
}
.check-row.open .chev { transform: rotate(90deg); }

/* ── Expanded detail panel ─────────────────────────────── */
.check-detail-panel {
    display: none;
    padding: 0.1rem 0 1rem 2.5rem;
    border-bottom: 1px solid var(--border);
}
.check-row.open + .check-detail-panel { display: block; }
.check-detail-panel:last-child { border-bottom: none; }

.check-detail-text {
    font-size: 0.85rem;
    color: var(--text-mid);
    line-height: 1.65;
    margin-bottom: 0.75rem;
}

.record-block {
    background: var(--bg-off);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.77rem;
    color: var(--text-mid);
    word-break: break-all;
    line-height: 1.55;
    margin-bottom: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fix-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.4rem;
}
.fix-block {
    background: #1d1d1f;
    color: #b0bec5;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.77rem;
    white-space: pre-wrap;
    line-height: 1.65;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── SMTP log ──────────────────────────────────────────── */
.log-box {
    background: #1d1d1f;
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    line-height: 1.65;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.5rem;
}
.log-out { color: #64b5f6; display: block; }
.log-in  { color: #b0bec5; display: block; }

/* ── DNS table ─────────────────────────────────────────── */
.dns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.5rem;
}
@media (min-width: 640px) { .dns-table { display: table; } }
.dns-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
    padding: 0.4rem 0.65rem;
    border-bottom: 1px solid var(--border);
}
.dns-table td {
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.dns-table tr:last-child td { border-bottom: none; }

/* ── DNS Lookup ────────────────────────────────────────── */
.lookup-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    flex-direction: column;
}
@media (min-width: 420px) { .lookup-row { flex-direction: row; } }

.domain-input {
    flex: 1;
    background: var(--bg-off);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    outline: none;
    font-family: var(--font);
    transition: border-color 0.15s, background 0.15s;
    -webkit-appearance: none;
}
.domain-input:focus { border-color: var(--blue); background: var(--bg); }
.domain-input::placeholder { color: var(--text-soft); }

/* ── Scan progress indicator ───────────────────────────── */
.scan-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-bottom: 1.25rem;
}
.scan-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    flex-shrink: 0;
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.7)} }
.scan-status.done .scan-dot { animation: none; background: var(--green); }

/* ── Domain score strip (DNS lookup) ───────────────────── */
.domain-score-strip {
    background: var(--bg-off);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.dscore-num {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}
.dscore-num.pass { color: var(--green); }
.dscore-num.warn { color: var(--amber); }
.dscore-num.fail { color: var(--red); }
.dscore-denom { font-size: 1rem; color: var(--text-soft); font-weight: 400; }
.dscore-info  { flex: 1; }
.dscore-label { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.15rem; }
.dscore-label.pass { color: var(--green); }
.dscore-label.warn { color: var(--amber); }
.dscore-label.fail { color: var(--red); }
.dscore-domain { font-size: 0.82rem; color: var(--text-soft); font-family: var(--font-mono); }

/* ── Share strip ───────────────────────────────────────── */
.share-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-off);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-top: 2rem;
    overflow: hidden;
}
.share-url {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ── DKIM vendor badges ────────────────────────────────── */
.dkim-sigs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.dkim-sig-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.dkim-sig-selector {
    font-size: 0.78rem;
    color: var(--text-mid);
}
.dkim-sig-selector code {
    font-family: var(--font-mono);
    background: var(--bg-off);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
    font-size: 0.75rem;
}
.vendor-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(0,113,227,0.08);
    color: var(--blue);
    border: 1px solid rgba(0,113,227,0.2);
    border-radius: 980px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    white-space: nowrap;
}
.vendor-note {
    font-size: 0.78rem;
    color: var(--text-soft);
    line-height: 1.5;
    padding-left: 1.1rem;
    margin-bottom: 0.25rem;
}

/* ── Mailto share button ───────────────────────────────── */
.mailto-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}
.mailto-share a.btn {
    background: var(--bg-off);
    color: var(--text-mid);
    border: 1px solid var(--border);
}
.mailto-share a.btn:hover { background: var(--border); color: var(--text); }

/* ── Footer ────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-soft);
    max-width: 680px;
    margin: 0 auto;
}

/* ── Utility ───────────────────────────────────────────── */
.hidden { display: none !important; }
.text-sm    { font-size: 0.85rem; }
.text-xs    { font-size: 0.78rem; }
.text-muted { color: var(--text-soft); }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
