:root {
    --ink: #17211f;
    --muted: #5d6865;
    --paper: #fffdf7;
    --panel: rgba(255, 255, 255, 0.82);
    --line: rgba(23, 33, 31, 0.12);
    --green: #0f6b58;
    --green-dark: #0a4d40;
    --gold: #d7a735;
    --coral: #c24f3d;
    --sky: #e4f4f1;
    --shadow: 0 24px 70px rgba(14, 42, 35, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    background:
        radial-gradient(circle at 10% 10%, rgba(215, 167, 53, 0.22), transparent 28rem),
        radial-gradient(circle at 88% 16%, rgba(15, 107, 88, 0.18), transparent 24rem),
        linear-gradient(135deg, #f8fbf5 0%, #eef7f4 48%, #fff8ea 100%);
}

button,
input {
    font: inherit;
}

.site-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.result-panel {
    width: min(100%, 580px);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
}

.brand-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 20px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green-dark), var(--green) 62%, var(--gold));
    box-shadow: 0 14px 35px rgba(15, 107, 88, 0.26);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: 0;
}

.lead {
    margin: 0 0 22px;
    color: var(--muted);
}

.result-form {
    display: grid;
    gap: 16px;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group label {
    font-size: 0.92rem;
    font-weight: 750;
}

.field-group input {
    width: 100%;
    min-height: 52px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-group input:focus {
    border-color: rgba(15, 107, 88, 0.7);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 107, 88, 0.12);
}

.field-error {
    min-height: 18px;
    color: var(--coral);
    font-size: 0.86rem;
}

.primary-button,
.secondary-button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
    color: #fff;
    background: var(--green);
    box-shadow: 0 16px 36px rgba(15, 107, 88, 0.25);
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.primary-button[disabled] {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.button-loader {
    width: 18px;
    height: 18px;
    display: none;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

.primary-button[aria-busy="true"] .button-loader {
    display: inline-block;
}

.form-alert {
    min-height: 22px;
    margin: 0;
    color: var(--coral);
    font-weight: 700;
}

.notice {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
}

.notice-closed {
    border-color: rgba(194, 79, 61, 0.24);
    color: #813328;
    background: rgba(255, 243, 238, 0.86);
}

.contact-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.92rem;
}

.result-modal[hidden] {
    display: none;
}

.result-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 24, 20, 0.58);
    backdrop-filter: blur(8px);
}

.modal-card {
    position: relative;
    width: min(100%, 480px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 28px;
    border-radius: 24px;
    background: var(--paper);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.26);
    animation: rise 180ms ease-out;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: var(--ink);
    background: var(--sky);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.status-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 18px;
    background: var(--green);
}

.status-icon.selected {
    background: linear-gradient(135deg, var(--green), #28a47f);
}

.status-icon.not-selected {
    background: linear-gradient(135deg, var(--coral), #e29351);
}

.status-icon.neutral {
    background: linear-gradient(135deg, #68716e, #a1aaa7);
}

.modal-card h2 {
    margin: 0 0 8px;
    font-size: 1.55rem;
    line-height: 1.2;
}

.modal-message {
    margin: 0 0 18px;
    color: var(--muted);
    font-weight: 700;
}

.result-details {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.result-details div {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.result-details dt {
    color: var(--muted);
    font-weight: 750;
}

.result-details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 850;
}

.instruction {
    margin: 0 0 18px;
    color: var(--muted);
}

.secondary-button {
    width: 100%;
    color: var(--green-dark);
    background: var(--sky);
}

.secondary-button:hover,
.secondary-button:focus-visible {
    background: #d5ebe6;
}

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

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 540px) {
    .site-shell {
        padding: 18px 12px;
        place-items: start center;
    }

    .result-panel {
        padding: 22px;
        border-radius: 22px;
    }

    .brand-row {
        align-items: flex-start;
    }

    .brand-mark {
        width: 54px;
        height: 54px;
        border-radius: 17px;
    }

    h1 {
        font-size: 1.55rem;
    }

    .result-details div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}

