:root {
    --brand-red: #8d2028;
    --brand-red-dark: #5f1118;
    --brand-gold: #c69a3f;
    --ink: #1f2933;
    --muted: #657281;
    --surface: #ffffff;
    --line: #d9dee5;
    --page: #f5f1ea;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
}

.brand-panel {
    display: flex;
    align-items: center;
    padding: clamp(2rem, 5vw, 5rem);
    color: #fff;
    background:
        linear-gradient(rgba(95, 17, 24, 0.9), rgba(95, 17, 24, 0.82)),
        url("../img/logo.png") center 18% / 420px auto no-repeat,
        var(--brand-red-dark);
}

.brand-inner {
    max-width: 560px;
}

.brand-logo {
    width: min(230px, 72vw);
    height: auto;
    display: block;
    margin-bottom: 2.5rem;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.26));
}

.brand-kicker,
.section-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 0.75rem;
    color: var(--brand-red-dark);
    background: #f5e7c2;
    border: 1px solid rgba(198, 154, 63, 0.38);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.brand-panel .brand-kicker {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
}

.brand-panel h1 {
    margin: 1rem 0;
    font-size: clamp(2.4rem, 4vw, 4.4rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-copy {
    max-width: 34rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.08rem;
}

.form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.2rem, 5vw, 4rem);
}

.form-card,
.thanks-card {
    width: min(100%, 760px);
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(31, 41, 51, 0.12);
}

.form-header {
    margin-bottom: 1.5rem;
}

.form-header h2,
.thanks-card h1 {
    margin: 0.75rem 0 0;
    color: var(--ink);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
}

.form-label {
    color: #374151;
    font-weight: 650;
}

.optional-label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.form-control {
    min-height: 52px;
    border-color: #cfd6df;
    border-radius: 7px;
}

.form-control:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 0.22rem rgba(141, 32, 40, 0.15);
}

.was-validated #ruc.form-control:valid:not(.is-valid) {
    border-color: #cfd6df;
    background-image: none;
    padding-right: 1rem;
}

.was-validated #ruc.form-control:valid:not(.is-valid):focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 0.22rem rgba(141, 32, 40, 0.15);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.7rem;
}

.btn {
    min-height: 50px;
    border-radius: 7px;
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--brand-red);
    --bs-btn-border-color: var(--brand-red);
    --bs-btn-hover-bg: var(--brand-red-dark);
    --bs-btn-hover-border-color: var(--brand-red-dark);
    --bs-btn-disabled-bg: #9ca3af;
    --bs-btn-disabled-border-color: #9ca3af;
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-red);
    --bs-btn-border-color: var(--brand-red);
    --bs-btn-hover-bg: var(--brand-red);
    --bs-btn-hover-border-color: var(--brand-red);
}

.alert {
    border-radius: 7px;
}

.site-footer {
    width: min(100%, 760px);
    margin-top: 1.1rem;
    color: var(--muted);
    font-size: 0.92rem;
    text-align: center;
}

.site-footer a {
    color: var(--brand-red);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.thanks-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.thanks-shell {
    width: min(100%, 760px);
    padding: 1rem;
}

.thanks-card {
    text-align: center;
}

.thanks-logo {
    width: min(210px, 70vw);
    height: auto;
    margin-bottom: 1.5rem;
}

.thanks-card p {
    color: var(--muted);
    font-size: 1.04rem;
    margin: 1rem 0 1.5rem;
}

.is-busy {
    opacity: 0.8;
    pointer-events: none;
}

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

    .brand-panel {
        min-height: 34vh;
        align-items: flex-end;
        padding: 2rem 1.1rem;
        background-size: 260px auto;
    }

    .brand-logo {
        width: 168px;
        margin-bottom: 1.2rem;
    }

    .brand-panel h1 {
        font-size: 2.15rem;
    }

    .form-panel {
        padding: 1rem;
    }
}

@media (max-width: 520px) {
    .brand-copy {
        font-size: 1rem;
    }

    .form-card,
    .thanks-card {
        padding: 1rem;
    }

    .actions {
        display: grid;
    }

    .btn {
        width: 100%;
    }
}
