:root {
    color-scheme: light;
    --navy: #0a2a5e;
    --blue: #1677e6;
    --red: #e23b3b;
    --hdr: #ffffff;
    --card: #ffffff;
    --ink: #0d1b3a;
    --muted: #51607c;
    --ice: #e5f1ff;
    --bg: #f8f9fa;
    --bg-img: url("../assets/bg.png");
    --bg-overlay: linear-gradient(rgba(7, 27, 63, .6), rgba(7, 27, 63, .6));
    --page-w: 880px;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html {
    scroll-padding-top: env(safe-area-inset-top, 0px);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Jost', sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    overflow-x: clip;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: var(--bg-overlay), var(--bg-img);
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
}

body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: env(safe-area-inset-top, 0px);
    background: var(--hdr);
    z-index: 100;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: 0;
    background: none;
}

:focus-visible {
    outline: 3px solid #7cc0ff;
    outline-offset: 2px;
}

svg {
    display: block;
}

.top {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    background: var(--hdr);
    min-height: 96px;
    overflow: hidden;
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 100;
    width: 100%;
    max-width: var(--page-w);
    margin: 0 auto;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
}

.nav {
    display: flex;
    align-items: center;
    background: var(--navy);
    padding: 0 36px 0 40px;
    margin-left: 12px;
}

.steps {
    margin-top: 16px;
    background: var(--card);
    padding: 26px 34px 50px;
    position: relative;
    overflow: hidden;
}

.steps h2 {
    margin: 0 0 40px;
    font-size: clamp(1.2rem, 2.6vw, 1.55rem);
    font-weight: 300;
    border-left: 5px solid var(--blue);
    padding-left: 14px;
    line-height: 1.2;
}

@media (max-width: 900px) {
    .steps {
        padding: 22px 20px;
    }
}

@media (max-width: 420px) {
    .steps {
        padding: 20px 16px;
    }
}

.form-card,
.pay-modal {
    color-scheme: light;
    --card: #ffffff;
    --ink: #0d1b3a;
    --muted: #51607c;
    --ice: #e5f1ff;
    --field: #ffffff;
    --line: #c3d1e6;
    --danger: #c62828;
    --danger-bg: #fdecec;
    --ok: #16a34a;
    color: var(--ink);
    background: #ffffff;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: clip;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.form-page > *,
.form-card form,
.form-grid > * {
    min-width: 0;
}

.logo {
    min-width: 0;
}

.logo img {
    display: block;
    max-width: 100%;
    height: auto;
}

.nav {
    flex: none;
}

.nav a {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 300;
    font-size: 1rem;
    padding: 6px 30px;
    text-align: center;
    text-decoration: none;
    transition: transform .25s ease, color .25s ease;
}

.nav a+a {
    border-left: 1px solid rgba(255, 255, 255, .28);
}

.nav a:hover,
.nav a:focus-visible {
    color: #9fd0ff;
    transform: scale(1.1);
}

.form-page {
    display: block;
    width: 100%;
    max-width: var(--page-w);
    margin: 28px auto 36px;
    padding: 0;
}

.crumbs {
    flex: 0 0 100%;
    order: 3;
    padding: 10px 28px;
    background: #fff;
    border-top: 1px solid #c3d1e6;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size:  16px !important;
    color: var(--muted);
}

.crumbs li {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow-wrap: anywhere;
}

.crumbs li + li::before {
    content: "/";
    margin-right: 10px;
    color: #c3d1e6;
}

.link {
    display: flex !important;
    align-items: center !important;
    color: #0f63c4;
    text-decoration: none;
}

.crumbs [aria-current="page"] {
    font-weight: 300 !important;
    color: var(--ink);
}

.station-brand {
    gap: 16px;
}

.station-logo {
    flex: none;
    width: clamp(56px, 9vw, 72px);
    aspect-ratio: 1;
    object-fit: contain;
}

.top h1 {
    margin: 0;
    font-size: clamp(1.3rem, 3.4vw, 1.8rem);
    font-weight: 600;
    line-height: 1.15;
    color: var(--navy);
    overflow-wrap: anywhere;
}

.form-card {
    overflow: visible;
    padding-bottom: 36px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.field {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
}

.section-title {
    grid-column: 1 / -1;
    margin: 12px 0 -6px;
    padding-bottom: 8px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    display: none;
}

.section-title:first-child {
    margin-top: 0;
}

.field.full {
    grid-column: 1 / -1;
}

.field label,
.field .label {
    font-size: 18px;
    font-weight: 300;
    color: var(--ink);
    margin: 5px 0 5px;
}

.field label span {
    font-style: italic;
    opacity: 0.6;
}

.input {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 14px;
    transition: border-color .2s ease, background-color .2s ease;
}

.input:focus {
    border-color: var(--blue);
}

.input::placeholder {
    color: var(--muted);
    opacity: .75;
}

textarea.input {
    min-height: 150px;
    line-height: 1.5;
    resize: vertical;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 10px;
}

.type-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.type-card input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.type-card span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
    padding: 14px 16px;
    text-align: center;
    font-weight: 300;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    transition: transform .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}

.type-card svg {
    flex: none;
    width: 20px;
    height: 20px;
}

.type-card:hover span {
    transform: scale(1.04);
    border-color: var(--blue);
}

.type-card input:checked+span {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.type-card input:focus-visible+span {
    outline: 3px solid #7cc0ff;
    outline-offset: 2px;
}

.dynamic-fields {
    display: none;
    grid-column: 1 / -1;
    gap: 24px;
}

.dynamic-fields.active {
    display: grid;
}

.announcement-template {
    overflow-wrap: anywhere;
    padding: 18px 22px;
    font-size: 1.02rem;
    line-height: 1.9;
    background: var(--field);
    border: 1px solid var(--line);
}

.blank-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 4px 0 8px;
}

.preview-label {
    margin-top: 10px;
}

.announcement-template .fill {
    padding: 1px 6px;
    font-weight: 600;
    color: var(--ink);
    background: var(--ice);
    border-bottom: 2px solid var(--blue);
    transition: background-color .2s ease, color .2s ease;
}

.announcement-template .fill.is-empty {
    font-weight: 400;
    font-style: italic;
    color: var(--muted);
}

.word-count {
    display: none;
    justify-content: flex-end;
    margin-top: -10px;
}

.word-count span {
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
}

.word-count span.is-over {
    font-weight: 600;
    color: var(--danger);
}

.field-hint {
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
}

.broadcast-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    grid-column: 1 / -1;
    align-items: stretch;
}

.broadcast-row .price-display {
    margin-top: 0;
}

.price-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
    padding: 18px 22px;
    color: var(--ink);
    background: transparent;
}

.price-display span:first-child {
    font-weight: 500;
}

.price-display span:last-child {
    font-size: 1.6rem;
    font-weight: 600;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}

.primary,
.secondary {
    display: inline-block;
    padding: 10px 24px;
    font-size: .95rem;
    font-weight: 300 !important;
    text-align: center;
    text-decoration: none;
    text-transform: capitalize;
    border: 1px solid transparent;
    transition: transform .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}

.primary {
    color: #fff;
    background: var(--blue);
}

.primary:hover:not(:disabled),
.primary:focus-visible {
    background: #0f63c4;
    transform: scale(1.03);
}

.secondary {
    color: var(--ink);
    background: transparent;
    border-color: var(--line);
}

.secondary:hover:not(:disabled),
.secondary:focus-visible {
    color: var(--blue);
    border-color: var(--blue);
    transform: scale(1.03);
}

.primary:disabled,
.secondary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.pay-modal {
    width: min(480px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow-y: auto;
    border: 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.pay-modal::backdrop {
    background: rgba(7, 27, 63, .72);
}

.pay-panel {
    padding: 32px 30px 30px;
}

.pay-panel h2 {
    margin: 0 0 12px;
    padding-left: 14px;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
    border-left: 5px solid var(--blue);
}

.pay-panel p {
    overflow-wrap: anywhere;
    margin: 0 0 14px;
    line-height: 1.55;
    color: var(--muted);
}

.pay-panel .field {
    margin-top: 18px;
}

.pay-panel .pay-error {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-weight: 500;
    color: var(--danger);
}

.pay-panel .price-display {
    margin-top: 18px;
}

.pay-panel .price-display+p {
    margin-top: 10px;
}

.pay-failed h2 {
    border-left-color: var(--danger);
}

.pay-spinner {
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    border: 4px solid var(--ice);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: pay-spin .9s linear infinite;
}

@keyframes pay-spin {
    to {
        transform: rotate(360deg);
    }
}

.pay-success {
    text-align: center;
}

.pay-success svg {
    margin: 0 auto 16px;
}

.pay-success h2 {
    padding-left: 0;
    color: var(--ok);
    border-left: 0;
}

@media (max-width: 1000px) {
    .nav a {
        padding: 6px 18px;
    }
}

@media (max-width: 900px), (max-height: 560px) {
    .top {
        position: relative;
        top: auto;
    }
}

@media (max-width: 900px) {
    .top {
        flex-direction: column;
        flex-wrap: nowrap;
        min-height: 0;
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .form-page {
        max-width: none;
        margin: 0 0 24px;
    }

    .logo {
        padding: 12px 18px;
    }

    .crumbs {
        flex: none;
        padding: 10px 18px;
    }

    .nav {
        margin: 0;
        padding: 4px 8px;
        justify-content: space-around;
    }

    .nav {
        flex-wrap: wrap;
    }

    .nav a {
        flex: 1 1 90px;
        min-width: 0;
        padding: 8px 6px;
        font-size: .88rem;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 760px) {
    .form-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .form-grid,
    .blank-grid,
    .broadcast-row {
        grid-template-columns: 1fr;
    }

    .announcement-template {
        padding: 14px 16px;
    }

    .actions {
        flex-wrap: nowrap;
    }

    .actions .primary,
    .actions .secondary {
        flex: 1 1 0;
        padding: 10px 12px;
    }
}

@media (max-width: 420px) {
    .pay-panel {
        padding: 26px 20px 22px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .nav a,
    .type-card span,
    .primary,
    .secondary,
    .announcement-template .fill {
        transition: none;
    }

    .nav a:hover,
    .nav a:focus-visible,
    .type-card:hover span,
    .primary:hover:not(:disabled),
    .primary:focus-visible,
    .secondary:hover:not(:disabled),
    .secondary:focus-visible {
        transform: none;
    }

    .pay-spinner {
        animation-duration: 2.4s;
    }
}