:root {
    --bg: #f5f1ea;
    --paper: #fffdf9;
    --ink: #2b241f;
    --muted: #6f5c4b;
    --line: #decebb;
    --gold: #b38b59;
    --deep: #3a2c21;
    --button: #5f4734;
    --button-hover: #4b3829;
    --error-bg: #fff0ee;
    --error-border: #d58c84;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(179,139,89,.08), transparent 28%),
        linear-gradient(180deg, #f3ede4 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
}

.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 18px 60px;
}

.hero {
    background: linear-gradient(135deg, #2b221a 0%, #5d4633 100%);
    color: #f5ede3;
    border-radius: 22px;
    padding: 34px 30px;
    box-shadow: 0 18px 50px rgba(38, 26, 16, .18);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -40px -60px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.1), transparent 70%);
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 2;
}

.hero-copy {
    flex: 1 1 65%;
    min-width: 0;
}

.hero-mark {
    flex: 0 0 220px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-mark img {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.18));
    opacity: .96;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: 12px;
    opacity: .78;
    margin-bottom: 10px;
    font-weight: bold;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.04;
}

.hero p {
    margin: 0;
    max-width: 780px;
    color: #eee4d7;
    font-size: 18px;
    line-height: 1.6;
}

.layout {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 24px;
    margin-top: 24px;
}

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(37, 28, 19, .07);
}

.card-pad {
    padding: 28px;
}

h2 {
    margin: 0 0 14px;
    font-size: 28px;
}

.lede {
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 24px;
}

.waiver-box {
    border: 1px solid var(--line);
    background: #fdfaf6;
    border-radius: 16px;
    padding: 22px;
    max-height: 460px;
    overflow: auto;
    line-height: 1.72;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
    font-weight: bold;
}

input, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    color: var(--ink);
}

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

input:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(179,139,89,.12);
}

.checks {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.check {
    display: flex;
    gap: 10px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fcfaf6;
}

.check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.check span {
    display: block;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
}

.legal-warning {
    background: #fff4d8;
    border: 2px solid #c79a2b;
    padding: 18px;
    border-radius: 14px;
    margin: 20px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #3a2c21;
}

.sig-wrap {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.sig-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fcfaf6;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.sig-top strong {
    font-size: 15px;
}

.sig-top span {
    color: var(--muted);
    font-size: 14px;
}

canvas {
    width: 100%;
    height: 120px;
    display: block;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.hero-actions {
    margin-top: 18px;
}

.back-button {
    min-width: 140px;
}

.signature-actions {
    margin-top: 16px;
}

.signature-submit-row {
    display: flex;
    margin-top: 16px;
}

.signature-submit-row button,
.signature-submit-row .button-link {
    width: 100%;
}

.signature-secondary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.signature-secondary-row button,
.signature-secondary-row .button-link {
    width: 100%;
}

.download-row {
    margin-top: 12px;
}

button,
.button-link {
    appearance: none;
    border: none;
    border-radius: 999px;
    background: var(--button);
    color: #fff;
    padding: 13px 20px;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.button-link:hover {
    background: var(--button-hover);
}

.button-secondary {
    background: #eadfce;
    color: var(--deep);
}

.button-secondary:hover {
    background: #dfd0bb;
}

button[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.notice {
    padding: 16px 18px;
    border-radius: 16px;
    margin-bottom: 18px;
    border: 1px solid;
}

.notice.error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: #6b2b24;
}

.notice ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.small {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.footer-note {
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 20, 14, .58);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-box {
    background: #fffdf9;
    border: 1px solid #decebb;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 18px 45px rgba(0,0,0,.18);
}

.modal-box h3 {
    margin: 0 0 12px;
    font-size: 28px;
    color: #2b241f;
}

.modal-box p {
    margin: 0 0 10px;
    color: #6f5c4b;
    line-height: 1.6;
}

.modal-box button {
    margin-top: 12px;
}

#waiverScrollStatus {
    margin-top: 12px;
}

@media (max-width: 920px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .card-pad {
        padding: 22px;
    }

    .hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-mark {
        justify-content: flex-start;
    }

    .hero-mark img {
        max-width: 180px;
    }

    .signature-secondary-row {
        grid-template-columns: 1fr;
    }
}