* {
    box-sizing: border-box;
}

:root {
    --color-text: #1f2933;
    --color-muted: #5d6975;
    --color-primary: #0f6f8f;
    --color-primary-dark: #0a536d;
    --color-primary-soft: #e0f2f9;
    --color-border: #d3e5ec;
    --color-border-strong: #b8c7d0;
    --color-surface: #ffffff;
    --color-surface-soft: #f6fafc;
    --shadow-soft: 0 10px 28px rgb(15 111 143 / 10%);
    --shadow-medium: 0 16px 40px rgb(15 111 143 / 14%);
    --shadow-inset: inset 0 1px 0 rgb(255 255 255 / 80%);
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 18px;
    --content-width: 960px;
    --content-gutter: 16px;
}

body {
    margin: 0;
    color: var(--color-text);
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background:
        radial-gradient(circle at top left, rgb(15 111 143 / 16%) 0, transparent 320px),
        linear-gradient(180deg, #e0f2f9 0%, #ffffff 460px);
    background-repeat: no-repeat;
}

header {
    padding-bottom: 28px;
}

main {
    padding: 12px 0 28px;
}

main > section,
footer {
    width: min(100% - (var(--content-gutter) * 2), var(--content-width));
    margin: 0 auto;
}

footer {
    padding: 16px 0 32px;
    color: var(--color-muted);
}

.hero {
    padding-top: 34px;
    display: grid;
    gap: 28px;
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 5px solid white;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-medium);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px max(var(--content-gutter), calc((100% - var(--content-width)) / 2));
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    box-shadow: 0 6px 18px rgb(15 83 109 / 16%);
    border-bottom: 5px solid white;
}

.topbar a {
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.brand img {
    height: 50px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 720px;
    margin-bottom: 16px;
    color: #163042;
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

h2 {
    margin-bottom: 10px;
    color: #163042;
    font-size: 1.45rem;
    line-height: 1.2;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--color-primary);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

a {
    color: #075985;
    font-weight: 700;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--color-primary-dark);
}

.hero > div > a,
.contact-button,
button {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    padding: 3px 20px;
    top: -8px;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    box-shadow: 0 10px 20px rgb(15 111 143 / 18%);
    cursor: pointer;
    transition:
        background 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

button {
    padding: 10px 20px;
}

.contact-button {
    flex: 0 0 auto;
    border: 1px solid rgb(255 255 255 / 85%);
}

.hero > div > a:hover,
.contact-button:hover,
button:hover {
    color: #ffffff;
    box-shadow: 0 14px 26px rgb(15 111 143 / 22%);
    transform: translateY(-1px);
}

.hero > div > a:active,
.contact-button:active,
button:active {
    box-shadow: 0 8px 16px rgb(15 111 143 / 18%);
    transform: translateY(0);
}

.hero > div > a {
    margin: 8px 0 14px;
}

form {
    border: 1px solid rgb(211 229 236 / 90%);
    border-radius: var(--radius-large);
    padding: 24px;
    background: rgb(255 255 255 / 92%);
    box-shadow: var(--shadow-soft), var(--shadow-inset);
    backdrop-filter: blur(8px);
}

label,
legend {
    display: block;
    margin-bottom: 7px;
    color: #263847;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-small);
    padding: 11px 12px;
    color: var(--color-text);
    font: inherit;
    background: var(--color-surface);
    box-shadow: inset 0 1px 2px rgb(31 41 51 / 5%);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

input:hover,
textarea:hover {
    border-color: #98adb8;
}

input:focus,
textarea:focus {
    outline: 0;
    border-color: var(--color-primary);
    box-shadow:
        0 0 0 3px rgb(15 111 143 / 14%),
        inset 0 1px 2px rgb(31 41 51 / 5%);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

fieldset {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 14px;
    margin: 0;
    border: 0;
    padding: 0;
}

fieldset p {
    margin-bottom: 2px;
    color: var(--color-muted);
}

fieldset label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-weight: 400;
    break-inside: avoid;
}

.province-options {
    columns: 1;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-weight: 400;
}

fieldset input {
    width: auto;
}

.checkbox input {
    width: auto;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--color-primary);
}

.error {
    min-height: 24px;
    margin: 4px 0 8px;
    color: #a3311f;
    font-size: 0.92rem;
}

.warning {
    min-height: 22px;
    margin: 4px 0 0;
    color: #8a5a00;
    font-size: 0.9rem;
}

.success {
    margin: 14px 0 0;
    color: #176a3a;
    font-weight: 700;
}

.email-preview {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    /* max-height: 1120px; */
    margin-top: 18px;
    border: 1px solid #dde6eb;
    border-radius: var(--radius-large);
    padding: 18px 12px;
    background:
        linear-gradient(180deg, rgb(255 255 255 / 56%), rgb(244 248 250 / 96%)),
        #f4f4f4;
    box-shadow: var(--shadow-soft);
    cursor: default;
    text-align: center;
    border: 2px solid white;
}

.email-preview::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 300px;
    content: "";
    pointer-events: none;
    background: linear-gradient(180deg, rgb(244 248 250 / 0%) 0%, #f4f8fa 100%);
}

.email-preview table {
    max-width: 100% !important;
}

.email-preview > table {
    width: 680px !important;
    margin: 0 auto;
    border-radius: var(--radius-medium);
    box-shadow: 0 10px 30px rgb(31 41 51 / 10%);
}

.email-preview img {
    max-width: 100% !important;
    height: auto !important;
}

.email-preview * {
    cursor: default;
}

@media (min-width: 680px) {
    .hero {
        padding-top: 44px;
        grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
        align-items: start;
    }

    .hero-image {
        grid-column: 1 / -1;
    }

    .province-options {
        columns: 2;
    }
}

@media (max-width: 520px) {
    :root {
        --content-gutter: 12px;
    }

    .topbar {
        padding-right: var(--content-gutter);
        padding-left: var(--content-gutter);
    }

    .brand {
        font-size: 1.5rem;
    }

    form {
        padding: 18px;
        border-radius: var(--radius-medium);
    }

    .email-preview {
        max-height: 1680px;
        padding: 12px 8px;
        border-radius: var(--radius-medium);
    }

    .email-preview td[width="220"],
    .email-preview td[valign="top"] {
        display: block;
        width: 100% !important;
    }

    .email-preview img {
        width: 100% !important;
        max-width: 220px !important;
    }
}
