/* CRM banner */
.ad-banner {
    position: relative;
    margin: 0 0 20px;
    border-radius: 18px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255, 138, 61, 0.38) 0%, rgba(255, 138, 61, 0) 55%),
        radial-gradient(90% 120% at 100% 100%, rgba(142, 214, 58, 0.30) 0%, rgba(142, 214, 58, 0) 60%),
        linear-gradient(120deg, #111a17 0%, #1a2420 100%);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(12, 22, 19, 0.18);
}

.ad-banner[hidden] {
    display: none;
}

.ad-banner__track {
    display: grid;
}

.ad-banner__slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateX(12px);
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}

.ad-banner__slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s;
}

.ad-banner__dots {
    position: absolute;
    left: 50%;
    bottom: 7px;
    display: flex;
    gap: 6px;
    transform: translateX(-50%);
}

.ad-banner__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.ad-banner__dot.is-active {
    width: 20px;
    background: #ffb347;
}

@media (prefers-reduced-motion: reduce) {
    .ad-banner__slide,
    .ad-banner__slide.is-active {
        transform: none;
        transition: none;
    }
}

.ad-banner__link {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 56px 20px 14px;
    color: inherit;
    text-decoration: none;
}

.ad-banner__link:hover {
    text-decoration: none;
}

.ad-banner__media {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.ad-banner__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-banner__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ad-banner__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.ad-banner__title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}

.ad-banner__text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.35;
}

.ad-banner__cta {
    flex: 0 0 auto;
    padding: 11px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb347 0%, #ff7a3d 100%);
    color: #1b0d00;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ad-banner__link:hover .ad-banner__cta {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(255, 122, 61, 0.4);
}

.ad-banner__close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    font-size: 20px;
    line-height: 30px;
    cursor: pointer;
}

.ad-banner__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

@media (max-width: 640px) {
    .ad-banner__link {
        flex-wrap: wrap;
        gap: 12px;
        padding-right: 44px;
    }

    .ad-banner__media {
        width: 56px;
        height: 56px;
    }

    .ad-banner__body {
        flex-basis: calc(100% - 70px);
    }

    .ad-banner__title {
        font-size: 16px;
    }

    .ad-banner__cta {
        width: 100%;
        text-align: center;
    }
}

/* Admin list */
.ads-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ads-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e3ebe6);
}

.ads-stat__value {
    font-size: 24px;
    font-weight: 800;
}

.ads-stat__label {
    font-size: 13px;
    color: var(--text-muted, #5b6f67);
}

.ads-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef1ef;
    color: #5b6f67;
}

.ads-status--live { background: #dcf5e6; color: #11743f; }
.ads-status--scheduled { background: #e3eefc; color: #1f55a8; }
.ads-status--unpaid { background: #fff1d6; color: #8a5a00; }
.ads-status--paused { background: #f1f1f1; color: #555; }
.ads-status--first { margin-top: 6px; background: #fff0e3; color: #b34a00; }

.ads-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ads-slots__item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px dashed var(--border, #e3ebe6);
}

.ads-slots__label {
    font-weight: 700;
}

.ads-slots__value,
.ads-slots__first {
    font-size: 13px;
    color: var(--text-muted, #5b6f67);
}

.ads-preview {
    margin-bottom: 18px;
}

.ads-preview__label {
    font-size: 13px;
    color: var(--text-muted, #5b6f67);
    margin-bottom: 8px;
}

.ads-preview .ad-banner__close {
    display: none;
}

.ads-delete {
    margin-top: 16px;
}

/* Landing block */
.site-ads {
    padding: 56px 0;
}

.site-ads__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.site-ads__head .section-title {
    margin: 0;
}

.site-ads__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #52525b);
}

.site-ads__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.site-ads__grid--1 {
    grid-template-columns: minmax(0, 1fr);
}

.site-ads__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-ad {
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: #111a17;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 16px 40px rgba(12, 22, 19, 0.14);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.site-ad:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(12, 22, 19, 0.22);
    text-decoration: none;
}

.site-ads__grid--1 .site-ad {
    flex-direction: row;
    min-height: 260px;
}

.site-ad__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1d2824;
}

.site-ads__grid--1 .site-ad__media {
    flex: 0 0 48%;
    aspect-ratio: auto;
}

.site-ad__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-ad__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px 24px;
    flex: 1 1 auto;
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(255, 138, 61, 0.28) 0%, rgba(255, 138, 61, 0) 60%),
        linear-gradient(160deg, #111a17 0%, #18231f 100%);
}

.site-ads__grid--1 .site-ad__body {
    justify-content: center;
    padding: 36px 40px;
}

.site-ad__brand {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.site-ad__title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.site-ads__grid--1 .site-ad__title {
    font-size: 30px;
}

.site-ad__text {
    font-size: 15px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
}

.site-ad__cta {
    align-self: flex-start;
    margin-top: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb347 0%, #ff7a3d 100%);
    color: #1b0d00;
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 860px) {
    .site-ads {
        padding: 40px 0;
    }

    .site-ads__head {
        flex-direction: column-reverse;
        align-items: center;
        gap: 6px;
        text-align: center;
    }

    .site-ads__grid,
    .site-ads__grid--2 {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .site-ads__grid::-webkit-scrollbar {
        display: none;
    }

    .site-ads__grid .site-ad {
        flex: 0 0 84%;
        scroll-snap-align: start;
    }

    .site-ads__grid--1 .site-ad {
        flex-basis: 100%;
    }

    .site-ad__media {
        aspect-ratio: 2 / 1;
    }

    .site-ad__body {
        padding: 18px 20px 20px;
    }

    .site-ad__title {
        font-size: 19px;
    }

    .site-ads__grid--1 .site-ad {
        flex-direction: column;
    }

    .site-ads__grid--1 .site-ad__media {
        aspect-ratio: 16 / 9;
    }

    .site-ads__grid--1 .site-ad__body {
        padding: 22px 24px 24px;
    }

    .site-ads__grid--1 .site-ad__title {
        font-size: 22px;
    }
}

/* Apply dialog */
html.ad-apply-open {
    overflow: hidden;
}

.ad-apply-dialog {
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    border-radius: 28px;
    background: #fff;
    color: #10231c;
    box-shadow: 0 40px 100px rgba(8, 16, 13, 0.35);
    overflow: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ad-apply-dialog::backdrop {
    background: rgba(8, 16, 13, 0.62);
    backdrop-filter: blur(6px);
}

.ad-apply-dialog[open] {
    animation: ad-apply-in 0.28s ease;
}

@keyframes ad-apply-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.ad-apply-dialog__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(16, 35, 28, 0.06);
    color: #10231c;
    font-size: 24px;
    line-height: 38px;
    cursor: pointer;
}

.ad-apply-dialog__close:hover {
    background: rgba(16, 35, 28, 0.12);
}

.ad-apply {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    min-height: 560px;
}

.ad-apply__visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 36px 28px;
    background:
        radial-gradient(90% 60% at 50% 0%, rgba(255, 138, 61, 0.35) 0%, rgba(255, 138, 61, 0) 70%),
        radial-gradient(80% 60% at 50% 100%, rgba(142, 214, 58, 0.30) 0%, rgba(142, 214, 58, 0) 70%),
        #111a17;
}

.ad-apply__caption {
    margin: 0;
    max-width: 240px;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
}

.ad-apply__soon {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 179, 71, 0.18);
    color: #ffb347;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Phone mockup */
.ad-phone {
    width: 240px;
    padding: 9px;
    border-radius: 40px;
    background: linear-gradient(145deg, #2a2f2d, #0b0f0d);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: rotate(-3deg);
}

.ad-phone__screen {
    position: relative;
    container-type: inline-size;
    border-radius: 32px;
    overflow: hidden;
    background: #eef8ef;
}

.ad-phone__screen img {
    display: block;
    width: 100%;
    height: auto;
}

.ad-phone__slot {
    position: absolute;
    left: 0;
    right: 0;
    top: 49.2%;
    height: 21.4%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.4cqw;
    padding: 0 4.6cqw;
    background: #edf7ee;
}

.ad-phone__slot-label {
    font-size: 4.2cqw;
    font-weight: 700;
    color: #1f3d2c;
}

.ad-phone__card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 3cqw;
    padding: 3.6cqw;
    border-radius: 4.6cqw;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255, 138, 61, 0.45) 0%, rgba(255, 138, 61, 0) 60%),
        linear-gradient(120deg, #111a17 0%, #1d2a25 100%);
    color: #fff;
    box-shadow: 0 2.4cqw 6cqw rgba(16, 35, 28, 0.25);
    animation: ad-phone-pulse 2.6s ease-in-out infinite;
}

@keyframes ad-phone-pulse {
    0%, 100% { box-shadow: 0 2.4cqw 6cqw rgba(16, 35, 28, 0.25), 0 0 0 0 rgba(255, 138, 61, 0.55); }
    50% { box-shadow: 0 2.4cqw 6cqw rgba(16, 35, 28, 0.25), 0 0 0 2.2cqw rgba(255, 138, 61, 0); }
}

.ad-phone__thumb {
    flex: 0 0 12cqw;
    height: 12cqw;
    border-radius: 3cqw;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0 18%, transparent 18%),
        linear-gradient(135deg, #ffb347 0%, #ff7a3d 100%);
}

.ad-phone__copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6cqw;
}

.ad-phone__title {
    font-size: 4.4cqw;
    font-weight: 800;
    line-height: 1.15;
}

.ad-phone__text {
    font-size: 3.3cqw;
    color: rgba(255, 255, 255, 0.72);
}

.ad-phone__cta {
    flex: 0 0 auto;
    padding: 2cqw 2.8cqw;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb347 0%, #ff7a3d 100%);
    color: #1b0d00;
    font-size: 3.2cqw;
    font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
    .ad-phone__card,
    .ad-apply-dialog[open] {
        animation: none;
    }
}

/* Pitch and form */
.ad-apply__main,
.ad-apply__done {
    padding: 40px 44px 36px;
}

.ad-apply__main[hidden],
.ad-apply__done[hidden] {
    display: none;
}

.ad-apply__eyebrow {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff0e3;
    color: #b34a00;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ad-apply__title {
    margin: 14px 0 18px;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ad-apply__points {
    display: grid;
    gap: 12px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.ad-apply__points li {
    display: flex;
    gap: 12px;
    font-size: 14.5px;
    line-height: 1.45;
    color: #34473f;
}

.ad-apply__icon {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 11px;
    background: #f3f6f4;
    display: grid;
    place-items: center;
    font-size: 17px;
}

.ad-apply__form {
    display: grid;
    gap: 14px;
    padding-top: 22px;
    border-top: 1px solid #e3ebe6;
}

.ad-apply__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ad-apply__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.ad-apply__field > span,
.ad-apply__field legend {
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #34473f;
}

.ad-apply__field input,
.ad-apply__field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9e3dd;
    border-radius: 12px;
    background: #fff;
    color: #10231c;
    font: inherit;
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ad-apply__field input:focus,
.ad-apply__field textarea:focus {
    outline: none;
    border-color: #ff7a3d;
    box-shadow: 0 0 0 4px rgba(255, 122, 61, 0.15);
}

.ad-apply__field textarea {
    resize: vertical;
    min-height: 52px;
}

.ad-apply__err {
    min-height: 0;
    color: #c2410c;
    font-size: 12px;
}

.ad-apply__err:empty {
    display: none;
}

.ad-apply__errors {
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff1ea;
    color: #9a3412;
    font-size: 14px;
}

.ad-apply__errors[hidden] {
    display: none;
}

.ad-apply__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ad-apply__chip {
    position: relative;
    cursor: pointer;
}

.ad-apply__chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ad-apply__chip span {
    display: inline-block;
    padding: 9px 14px;
    border: 1px solid #d9e3dd;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: #34473f;
    transition: all 0.15s ease;
}

.ad-apply__chip input:checked + span {
    border-color: #ff7a3d;
    background: #fff0e3;
    color: #9a3a00;
}

.ad-apply__chip input:focus-visible + span {
    box-shadow: 0 0 0 4px rgba(255, 122, 61, 0.2);
}

.ad-apply__submit {
    margin-top: 4px;
    padding: 15px 22px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffb347 0%, #ff7a3d 100%);
    color: #1b0d00;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ad-apply__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(255, 122, 61, 0.35);
}

.ad-apply__submit:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.ad-apply__note {
    margin: 0;
    font-size: 13px;
    color: #5b6f67;
    text-align: center;
}

.ad-apply__trap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.ad-apply__done {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.ad-apply__done h2 {
    margin: 10px 0 0;
    font-size: 26px;
}

.ad-apply__done p {
    margin: 0;
    max-width: 360px;
    color: #5b6f67;
    line-height: 1.5;
}

.ad-apply__done-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8ed63a 0%, #12a06a 100%);
    color: #fff;
    font-size: 32px;
    font-weight: 800;
}

/* Standalone page */
.ad-apply-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: #0c1613;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #10231c;
}

.ad-apply-page__card {
    width: min(980px, 100%);
    border-radius: 28px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
}

.ad-apply-page__card > .ad-apply__done {
    min-height: 360px;
}

@media (max-width: 820px) {
    .ad-apply {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .ad-apply__visual {
        padding: 28px 20px 22px;
    }

    .ad-phone {
        width: 150px;
        padding: 6px;
        border-radius: 28px;
    }

    .ad-phone__screen {
        border-radius: 23px;
    }

    .ad-apply__main,
    .ad-apply__done {
        padding: 26px 20px 24px;
    }

    .ad-apply__title {
        font-size: 23px;
    }

    .ad-apply__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-apply-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 100dvh;
        height: 100dvh;
        margin: 0;
        border-radius: 0;
    }
}
