:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #172b4d;
    background: #f3f6fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 36px 16px;
}

.container {
    width: min(100%, 940px);
    margin: 0 auto;
}

.page-header {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #176b5b;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.page-header > p:last-child {
    color: #53647b;
}

fieldset,
.notice {
    margin: 0 0 20px;
    padding: 22px;
    border: 1px solid #dce4ef;
    border-radius: 12px;
    background: #fff;
}

legend {
    padding: 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.optional-fields {
    margin-top: 20px;
    border-top: 1px solid #e8edf3;
}

.optional-fields summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    color: #315c50;
    font-size: .9rem;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}

.optional-fields summary::-webkit-details-marker {
    display: none;
}

.optional-fields summary::before {
    content: "+";
    display: grid;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    place-items: center;
    border: 1px solid #cbd9d1;
    border-radius: 50%;
    color: #176b5b;
    font-size: 1rem;
    line-height: 1;
}

.optional-fields[open] summary::before {
    content: "−";
}

.optional-fields summary span {
    margin-left: auto;
    color: #778696;
    font-size: .75rem;
    font-weight: 500;
}

.optional-grid {
    padding: 8px 0 4px;
}

.field {
    min-width: 0;
}

.field-wide {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: .92rem;
    font-weight: 600;
}

.required,
label span {
    color: #b42318;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #bdc9d8;
    border-radius: 7px;
    color: #172b4d;
    background: #fff;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #b8dcf7;
    border-color: #176b9a;
}

small {
    display: block;
    margin-top: 5px;
    color: #607087;
}

.error,
.error-box {
    color: #9b1c1c;
}

.error-box {
    border-color: #f0b8b8;
    background: #fff5f5;
}

.duplicate-notice {
    position: fixed;
    inset: 0;
    width: min(460px, calc(100% - 32px));
    max-height: min(90vh, 640px);
    margin: auto;
    overflow-y: auto;
    padding: 30px;
    border: 1px solid #f1d8c5;
    border-top: 5px solid #e58b45;
    border-radius: 20px;
    color: #172b4d;
    background: #fff;
    box-shadow: 0 28px 90px rgb(19 35 50 / 28%);
    text-align: center;
}

.duplicate-notice[open] {
    animation: duplicate-notice-enter .22s ease-out both;
}

.duplicate-notice::backdrop {
    background: rgb(18 31 45 / 62%);
    backdrop-filter: blur(5px);
}

.duplicate-notice-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
    text-align: left;
}

.duplicate-notice-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border: 1px solid #f2d5bd;
    border-radius: 18px;
    color: #c26019;
    background: radial-gradient(circle at 30% 25%, #fff8ef, #ffead8);
    box-shadow: inset 0 1px 0 #fff;
}

.duplicate-notice-icon svg {
    width: 29px;
    height: 29px;
}

.duplicate-notice-label {
    margin: 0;
    color: #a64b0b;
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.duplicate-notice-dismiss {
    display: grid;
    width: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    place-items: center;
    margin-left: auto;
    padding: 0;
    border: 1px solid #e7edf2;
    border-radius: 50%;
    color: #657487;
    background: #f7f9fb;
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
}

.duplicate-notice-dismiss:hover {
    border-color: #f1d8c5;
    color: #843d12;
    background: #fff4ea;
}

.duplicate-notice h2 {
    margin: 0 0 10px;
    color: #24364b;
    font-size: clamp(1.2rem, 4vw, 1.55rem);
    line-height: 1.25;
}

.duplicate-notice-description {
    max-width: 360px;
    margin: 0 auto;
    color: #5d6b7b;
    font-size: .95rem;
    line-height: 1.6;
}

.duplicate-notice-help {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid #f4dfcd;
    border-radius: 12px;
    color: #704b37;
    background: #fff9f3;
    font-size: .88rem;
    line-height: 1.5;
    text-align: left;
}

.duplicate-notice-help > span:last-child {
    display: grid;
    gap: 3px;
}

.duplicate-notice-help-icon {
    display: grid;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #d77a35;
    font-size: .82rem;
    font-weight: 800;
}

.duplicate-notice-help strong {
    color: #71330e;
}

.duplicate-notice-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.duplicate-notice-links a {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid #dce8e2;
    border-radius: 10px;
    color: #176b5b;
    background: #fff;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.duplicate-notice-links a:hover {
    transform: translateY(-1px);
    border-color: #a8cabc;
    background: #f3faf6;
}

.duplicate-notice-links a:focus-visible {
    outline: 3px solid #b8dcf7;
    outline-offset: 2px;
}

.duplicate-notice-close {
    width: 100%;
    min-height: 46px;
    margin-top: 18px;
    border-radius: 10px;
    background: #176b5b;
}

.duplicate-notice-close:hover {
    background: #115747;
}

.duplicate-notice-close:focus-visible {
    outline: 3px solid #b8dcf7;
    outline-offset: 2px;
}

@keyframes duplicate-notice-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .duplicate-notice[open] {
        animation: none;
    }

    .duplicate-notice-links a {
        transition: none;
    }
}

.success {
    border-color: #a8d8bd;
    background: #f0fbf4;
}

.success h2 {
    margin-top: 0;
}

.privacy-note {
    color: #53647b;
    font-size: .9rem;
    line-height: 1.6;
}

.wave-notice {
    margin: 0 0 16px;
    padding: 11px 13px;
    border-radius: 7px;
    color: #53647b;
    background: #f1f7f3;
    font-size: .87rem;
}

.wave-notice strong {
    color: #176b5b;
}

.print-button,
.pdf-download-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    margin-top: 6px;
    padding: 0 16px;
    border-radius: 7px;
    color: #fff;
    background: #176b5b;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
}

.print-button:hover,
.pdf-download-button:hover {
    background: #115747;
}

button {
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: #176b5b;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #115747;
}

footer {
    padding: 28px 0 8px;
    color: #708096;
    text-align: center;
}

@media (max-width: 620px) {
    body {
        padding: 24px 12px;
    }

    fieldset,
    .notice {
        padding: 16px;
    }

    .duplicate-notice {
        width: min(440px, calc(100% - 24px));
        padding: 22px 18px;
        border-radius: 16px;
    }

    .duplicate-notice-icon {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
        border-radius: 15px;
    }

    .duplicate-notice-icon svg {
        width: 26px;
        height: 26px;
    }

    .duplicate-notice-links {
        grid-template-columns: 1fr;
    }

    .duplicate-notice-dismiss {
        width: 36px;
        min-height: 36px;
        flex-basis: 36px;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}
