:root {
    --page-bg: #fbf6f7;
    --panel-bg: #ffffff;
    --panel-border: #f0d7dd;
    --text-main: #2a1820;
    --text-muted: #7c5f68;
    --brand: #e31937;
    --brand-deep: #be1430;
    --brand-soft: #fff0f3;
    --brand-soft-2: #f7cfd7;
    --success: #147651;
    --warning: #b3472b;
    --shadow: 0 24px 48px rgba(111, 22, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(227, 25, 55, 0.08), transparent 24%),
        linear-gradient(180deg, #fffefe 0%, var(--page-bg) 100%);
}

.page {
    width: min(980px, calc(100% - 24px));
    margin: 24px auto 42px;
}

.hero,
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 34px 30px;
    margin-bottom: 18px;
    background:
        linear-gradient(135deg, rgba(227, 25, 55, 0.05), rgba(255, 255, 255, 0) 42%),
        var(--panel-bg);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.08;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
}

h2 {
    font-size: 1.45rem;
}

.hero-text,
.panel-head p,
.note-block p,
.disclaimer {
    margin: 12px 0 0;
    color: var(--text-muted);
    line-height: 1.65;
    font-size: 1rem;
}

.panel {
    padding: 24px;
    margin-bottom: 18px;
}

.control-panel {
    border-top: 5px solid var(--brand);
}

.panel-head {
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "variant first last";
    gap: 14px;
    align-items: start;
}

.field-card-variant {
    grid-area: variant;
    width: 100%;
}

.field-card-first {
    grid-area: first;
}

.field-card-last {
    grid-area: last;
}

.field-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, #fff8f9 100%);
}

.field-label,
.label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 54px;
    padding: 14px 16px;
    border: 1px solid #e8c7cf;
    border-radius: 16px;
    background: #fff;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input::placeholder {
    color: #b38b95;
}

input:focus,
select:focus,
button:focus {
    outline: none;
    border-color: rgba(227, 25, 55, 0.55);
    box-shadow: 0 0 0 4px rgba(227, 25, 55, 0.12);
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    justify-content: center;
}

button {
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
    opacity: 0.97;
}

button:not(.secondary) {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
}

button.secondary {
    background: #fff;
    color: var(--text-main);
    border-color: #ebc8d0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.result-card {
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, #fff8f9 100%);
}

.result-card.emphasis {
    background: linear-gradient(180deg, #fff4f6 0%, #ffffff 100%);
    border-color: #efc4ce;
}

.value {
    margin-top: 7px;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.5;
}

.meta {
    margin-top: 6px;
    color: var(--text-muted);
    line-height: 1.55;
}

.status-ok {
    color: var(--success);
}

.status-warn {
    color: var(--warning);
}

#phenotypeCompatibility {
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
}

.note-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
    text-align: center;
}

.banner {
    display: none;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #efc0cb;
    border-radius: 16px;
    background: #fff0f3;
    color: var(--brand-deep);
}

.banner.visible {
    display: block;
}

.disclaimer {
    margin: 18px 2px 0;
    font-size: 0.96rem;
}

@media (max-width: 860px) {
    .form-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-areas:
            "variant"
            "first"
            "last";
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page {
        width: min(100% - 16px, 980px);
        margin-top: 16px;
    }

    .hero,
    .panel {
        padding: 18px;
        border-radius: 22px;
    }

    .actions {
        flex-direction: column;
    }

    .actions button {
        width: 100%;
    }
}
