/**
 * File: style.css
 * Version: 1.0.0
 * Description: Mobile-first production UI for Actual Email.
 */

:root {
    --bg: #f6f7f4;
    --bg-soft: #eef1eb;
    --surface: #ffffff;
    --surface-soft: #f9faf7;
    --text: #17201a;
    --text-soft: #5e6a61;
    --muted: #7a857d;
    --border: #dce3dc;
    --border-strong: #c9d4ca;

    --brand: #2f6f4e;
    --brand-dark: #23563c;
    --brand-soft: #e6f2eb;

    --blue: #315f8f;
    --blue-soft: #e7f0fa;

    --amber: #9a6b1f;
    --amber-soft: #fff4dc;

    --red: #9b3131;
    --red-soft: #fde8e8;

    --green: #237047;
    --green-soft: #e4f5eb;

    --shadow: 0 22px 70px rgba(23, 32, 26, 0.08);
    --shadow-soft: 0 12px 36px rgba(23, 32, 26, 0.06);

    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --container: 1160px;
    --header-height: 74px;

    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(47, 111, 78, 0.14), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(49, 95, 143, 0.12), transparent 32%),
        linear-gradient(180deg, var(--bg), #ffffff 72%);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(23, 32, 26, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 32, 26, 0.025) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    padding: 0;
    margin: 0;
}

li {
    list-style: none;
}

.page-shell {
    width: min(100%, var(--container));
    margin: 0 auto;
    padding: 14px 14px 28px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background:
        linear-gradient(135deg, rgba(47, 111, 78, 0.95), rgba(49, 95, 143, 0.92));
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    box-shadow: 0 10px 24px rgba(47, 111, 78, 0.24);
}

.brand strong,
.brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand strong {
    max-width: 160px;
    font-size: 1rem;
    letter-spacing: -0.03em;
}

.brand small {
    max-width: 160px;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 600;
}

.top-nav {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border: 1px solid rgba(220, 227, 220, 0.84);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
}

.top-nav a {
    padding: 8px 13px;
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
    transition: color 160ms ease, background 160ms ease;
}

.top-nav a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.language-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 4px 0 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-soft);
}

.language-bar span {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 650;
}

.language-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-form label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.language-form select {
    min-height: 40px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-weight: 800;
}

.hero {
    padding: 8px 0 18px;
}

.hero-card,
.result-card,
.about-card {
    border: 1px solid rgba(220, 227, 220, 0.95);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84)),
        radial-gradient(circle at top right, rgba(47, 111, 78, 0.1), transparent 38%);
    box-shadow: var(--shadow);
}

.hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    padding: 22px;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(47, 111, 78, 0.13), transparent 68%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 0 5px rgba(47, 111, 78, 0.13);
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -0.05em;
    line-height: 1.04;
}

h1 {
    max-width: 760px;
    font-size: clamp(2.25rem, 11vw, 5.6rem);
}

h2 {
    font-size: clamp(1.7rem, 6vw, 3.1rem);
}

h3 {
    font-size: 1.05rem;
}

.hero-text {
    max-width: 700px;
    margin: 18px 0 0;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.68;
}

.hero-note,
.form-hint,
.muted {
    color: var(--muted);
}

.hero-note {
    max-width: 720px;
    margin: 14px 0 0;
    font-size: 0.88rem;
}

.check-form {
    width: 100%;
    max-width: 860px;
    margin-top: 24px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(249, 250, 247, 0.9);
}

.check-form label {
    display: block;
    margin: 0 0 8px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 850;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.input-row input {
    width: 100%;
    min-height: 56px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: #ffffff;
    color: var(--text);
    padding: 0 16px;
    outline: none;
    font-size: 1rem;
    font-weight: 700;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.input-row input::placeholder {
    color: #9aa59d;
    font-weight: 650;
}

.input-row input:focus {
    border-color: rgba(47, 111, 78, 0.72);
    box-shadow: 0 0 0 5px rgba(47, 111, 78, 0.12);
}

.input-row button,
.secondary-button,
.details-toggle {
    min-height: 52px;
    border: 0;
    border-radius: 17px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #ffffff;
    font-weight: 850;
    box-shadow: 0 13px 26px rgba(47, 111, 78, 0.22);
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.input-row button:hover,
.secondary-button:hover,
.details-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 17px 34px rgba(47, 111, 78, 0.25);
}

.input-row button:active,
.secondary-button:active,
.details-toggle:active {
    transform: translateY(0);
}

.form-hint {
    margin: 10px 4px 0;
    font-size: 0.86rem;
}

.form-error {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(155, 49, 49, 0.18);
    border-radius: var(--radius-md);
    background: var(--red-soft);
    color: var(--red);
    font-size: 0.92rem;
    font-weight: 800;
}

.hero-side {
    display: none;
}

.score-preview {
    min-height: 360px;
    display: grid;
    place-items: center;
    gap: 14px;
    padding: 26px;
    border: 1px solid rgba(220, 227, 220, 0.9);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 24%, rgba(47, 111, 78, 0.22), transparent 34%),
        linear-gradient(180deg, rgba(249, 250, 247, 0.92), rgba(255, 255, 255, 0.82));
}

.score-preview span,
.score-preview strong {
    display: grid;
    place-items: center;
    width: 132px;
    height: 54px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-weight: 850;
    box-shadow: var(--shadow-soft);
}

.score-preview strong {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95), transparent 28%),
        linear-gradient(135deg, var(--brand), var(--blue));
    color: #ffffff;
    font-size: 1.3rem;
}

.result-section {
    padding: 16px 0;
}

.result-card {
    padding: 18px;
}

.result-header {
    display: grid;
    gap: 18px;
}

.result-header h2 {
    overflow-wrap: anywhere;
}

.score-badge {
    display: grid;
    gap: 4px;
    align-content: center;
    justify-items: start;
    width: 100%;
    min-height: 142px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.score-badge span,
.score-badge small {
    font-weight: 850;
}

.score-badge span {
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-badge strong {
    font-size: 3.2rem;
    letter-spacing: -0.08em;
    line-height: 1;
}

.score-high {
    background: var(--green-soft);
    color: var(--green);
}

.score-medium {
    background: var(--amber-soft);
    color: var(--amber);
}

.score-low {
    background: var(--red-soft);
    color: var(--red);
}

.summary-box,
.share-box,
.history-box,
.technical-box {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
}

.summary-box strong,
.share-box strong,
.history-box h3 {
    display: block;
    margin-bottom: 6px;
}

.summary-box p {
    margin: 0;
    color: var(--text-soft);
}

.signals-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.signal {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.signal-dot {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
}

.signal strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.96rem;
}

.signal span {
    display: block;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.signal-good .signal-dot {
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(35, 112, 71, 0.12);
}

.signal-warn .signal-dot {
    background: var(--amber);
    box-shadow: 0 0 0 5px rgba(154, 107, 31, 0.12);
}

.share-box {
    display: grid;
    gap: 12px;
}

.share-box span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secondary-button {
    width: 100%;
    background: var(--text);
    box-shadow: 0 13px 26px rgba(23, 32, 26, 0.16);
}

.secondary-button:hover {
    box-shadow: 0 17px 34px rgba(23, 32, 26, 0.2);
}

.history-grid {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.history-grid div {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.history-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.history-grid strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
    font-size: 1.05rem;
}

.details-toggle {
    width: 100%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    box-shadow: none;
}

.details-toggle:hover {
    box-shadow: none;
}

.technical-details {
    margin-top: 16px;
}

.technical-grid {
    display: grid;
    gap: 10px;
    margin: 12px 0 18px;
}

.technical-grid div {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.technical-grid strong {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.technical-grid span {
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 750;
}

.records {
    display: grid;
    gap: 10px;
}

.records h3 {
    margin-top: 12px;
    font-size: 0.98rem;
}

.record-list {
    display: grid;
    gap: 7px;
}

.record-list li,
.records pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}

.records pre {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.about-section {
    padding: 18px 0 8px;
}

.about-card {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.about-card p {
    margin: 14px 0 0;
    color: var(--text-soft);
}

.about-list {
    display: grid;
    gap: 10px;
}

.about-list li {
    position: relative;
    padding: 14px 14px 14px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-soft);
    font-weight: 650;
}

.about-list li::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 20px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 0 5px rgba(47, 111, 78, 0.1);
}

.site-footer {
    padding: 20px 4px 8px;
    color: var(--muted);
    text-align: center;
    font-size: 0.86rem;
}

.site-footer p {
    margin: 0;
}

.is-loading {
    pointer-events: none;
    opacity: 0.78;
}

.is-loading button[type="submit"] {
    position: relative;
    color: transparent;
}

.is-loading button[type="submit"]::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 22px;
    height: 22px;
    margin: auto;
    border: 3px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 520px) {
    .page-shell {
        padding: 18px 18px 34px;
    }

    .top-nav {
        display: inline-flex;
    }

    .input-row {
        grid-template-columns: 1fr auto;
    }

    .input-row button {
        min-width: 150px;
    }

    .share-box {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .secondary-button {
        width: auto;
        min-width: 178px;
    }

    .history-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .technical-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 760px) {
    .page-shell {
        padding: 22px 24px 40px;
    }

    .brand strong {
        max-width: 220px;
    }

    .brand small {
        max-width: 220px;
    }

    .hero-card {
        padding: 34px;
    }

    .result-card,
    .about-card {
        padding: 28px;
    }

    .result-header {
        grid-template-columns: minmax(0, 1fr) 220px;
        align-items: start;
    }

    .score-badge {
        justify-items: center;
        text-align: center;
    }

    .signals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-card {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        align-items: start;
    }
}

@media (min-width: 980px) {
    .hero {
        padding-top: 20px;
    }

    .hero-card {
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: center;
        min-height: calc(100vh - 150px);
    }

    .hero-side {
        display: block;
        position: relative;
        z-index: 2;
    }

    .hero-text {
        font-size: 1.08rem;
    }

    .check-form {
        padding: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}