:root {
    color-scheme: light;
    --purple: #302a8e;
    --purple-dark: #211d69;
    --purple-soft: #eeedff;
    --coral: #d63a32;
    --green: #1d9b63;
    --ink: #1b1c2d;
    --muted: #727487;
    --paper: #f5f4f7;
    --white: #fff;
    --line: #e4e2ea;
    --shadow: 0 24px 70px rgba(35, 31, 83, .13);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

body {
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 3px solid rgba(214, 58, 50, .34);
    outline-offset: 3px;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, .78fr) 1.22fr;
    background: var(--white);
}

.login-card {
    width: min(100%, 530px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 72px;
}

.login-brand,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand {
    position: absolute;
    top: 35px;
    left: 55px;
}

.login-brand img,
.sidebar-brand img {
    width: 65px;
    height: 52px;
    object-fit: contain;
}

.login-brand span,
.sidebar-brand span {
    display: grid;
}

.login-brand strong,
.sidebar-brand strong {
    color: var(--purple);
    font-size: 17px;
}

.login-brand small,
.sidebar-brand small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 9px;
    color: var(--coral);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.eyebrow.light {
    color: #ffaaa5;
}

.login-heading h1 {
    max-width: 390px;
    font-size: clamp(38px, 4vw, 56px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.login-heading p {
    max-width: 390px;
    margin: 20px 0 32px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.field {
    display: grid;
    gap: 8px;
}

.field > span {
    color: #4f5060;
    font-size: 12px;
    font-weight: 700;
}

.field > span small {
    color: var(--muted);
    font-weight: 500;
}

.field input,
.field textarea,
.field select,
.password-wrap {
    width: 100%;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field input,
.field select {
    height: 48px;
    padding: 0 14px;
}

.field textarea {
    padding: 13px 14px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.password-wrap:focus-within {
    outline: 0;
    border-color: rgba(48, 42, 142, .7);
    box-shadow: 0 0 0 4px rgba(48, 42, 142, .08);
}

.password-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    overflow: hidden;
}

.password-wrap input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}

.password-toggle {
    padding: 0 15px;
    color: var(--purple);
    background: transparent;
    border: 0;
    font-size: 11px;
    font-weight: 800;
}

.primary-button,
.secondary-button,
.danger-button,
.replace-button,
.logout-button {
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 20px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.primary-button {
    color: var(--white);
    background: linear-gradient(135deg, var(--purple), #544bc7);
    border: 0;
    box-shadow: 0 12px 28px rgba(48, 42, 142, .23);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
}

.primary-button.full {
    width: 100%;
    justify-content: space-between;
}

.secondary-button {
    color: var(--purple);
    background: var(--white);
    border: 1px solid rgba(48, 42, 142, .2);
}

.danger-button {
    min-height: 38px;
    color: #b12822;
    background: #fff2f1;
    border: 1px solid #f3cfcc;
}

.replace-button {
    min-height: 38px;
    color: var(--purple);
    background: var(--purple-soft);
    border: 0;
}

.form-error {
    min-height: 27px;
    padding-top: 7px;
    color: #b12822;
    font-size: 12px;
}

.back-link {
    width: fit-content;
    margin-top: 25px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.login-visual {
    min-height: 100vh;
    display: grid;
    place-items: end start;
    padding: 7vw;
    color: var(--white);
    background:
        linear-gradient(120deg, rgba(24, 22, 64, .92), rgba(48, 42, 142, .58)),
        url("../assets/hero-cleaning.jpg") center / cover;
}

.visual-card {
    display: grid;
    gap: 12px;
}

.visual-card > span {
    color: rgba(255, 255, 255, .7);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.visual-card > strong {
    font-size: clamp(42px, 5vw, 72px);
    line-height: 1;
    letter-spacing: -.06em;
}

.visual-pills {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.visual-pills i {
    padding: 8px 12px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 255px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
    color: var(--white);
    background:
        radial-gradient(circle at 20% 95%, rgba(214, 58, 50, .25), transparent 28%),
        var(--purple-dark);
}

.sidebar-brand {
    padding: 0 9px 32px;
}

.sidebar-brand strong {
    color: var(--white);
}

.sidebar-brand small {
    color: rgba(255, 255, 255, .55);
}

.sidebar-brand img {
    padding: 4px;
    background: var(--white);
    border-radius: 10px;
}

.panel-nav {
    display: grid;
    gap: 7px;
}

.nav-item {
    width: 100%;
    min-height: 49px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    color: rgba(255, 255, 255, .65);
    background: transparent;
    border: 0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    color: var(--white);
    background: rgba(255, 255, 255, .1);
}

.nav-icon {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .08);
    border-radius: 8px;
    font-size: 14px;
}

.sidebar-bottom {
    display: grid;
    gap: 8px;
    margin-top: auto;
}

.site-link,
.logout-button {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.logout-button {
    width: 100%;
}

.panel-main {
    min-width: 0;
    padding: 0 48px 70px;
}

.panel-header {
    min-height: 104px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.panel-header h1 {
    font-size: 25px;
    letter-spacing: -.04em;
}

.panel-header .eyebrow {
    margin-bottom: 2px;
}

.mobile-menu {
    display: none;
    width: 42px;
    height: 42px;
    color: var(--purple);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.admin-badge > span {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    color: var(--white);
    background: var(--purple);
    border-radius: 12px;
    font-weight: 800;
}

.admin-badge div {
    display: grid;
}

.admin-badge strong {
    font-size: 11px;
}

.admin-badge small {
    color: var(--muted);
    font-size: 9px;
}

.panel-section {
    width: min(100%, 1180px);
    padding-top: 38px;
}

.welcome-card {
    min-height: 225px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 35px;
    overflow: hidden;
    padding: 42px 48px;
    color: var(--white);
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .12), transparent 22%),
        linear-gradient(135deg, var(--purple-dark), var(--purple));
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.welcome-card h2 {
    max-width: 630px;
    font-size: clamp(27px, 3vw, 39px);
    line-height: 1.13;
    letter-spacing: -.045em;
}

.welcome-card p {
    max-width: 670px;
    margin-top: 14px;
    color: rgba(255, 255, 255, .67);
    font-size: 13px;
    line-height: 1.7;
}

.welcome-mark {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
    font-size: 58px;
    font-weight: 900;
    box-shadow: 0 0 0 25px rgba(255, 255, 255, .035), 0 0 0 50px rgba(255, 255, 255, .025);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
    margin-top: 21px;
}

.summary-card {
    min-height: 118px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 17px;
}

.summary-icon {
    width: 49px;
    height: 49px;
    flex: 0 0 49px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-weight: 800;
}

.summary-icon.purple {
    color: var(--purple);
    background: var(--purple-soft);
}

.summary-icon.green {
    color: var(--green);
    background: #e8f7f0;
}

.summary-icon.coral {
    color: var(--coral);
    background: #fff0ef;
}

.summary-card div {
    display: grid;
}

.summary-card strong {
    font-size: 25px;
    letter-spacing: -.04em;
}

.summary-card span:last-child {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
    margin-top: 21px;
}

.quick-grid button {
    min-height: 105px;
    display: grid;
    gap: 7px;
    padding: 24px;
    color: var(--ink);
    background: transparent;
    border: 1px dashed #c8c5d1;
    border-radius: 16px;
    text-align: left;
}

.quick-grid button:hover {
    background: var(--white);
    border-style: solid;
}

.quick-grid span {
    color: var(--muted);
    font-size: 10px;
}

.quick-grid strong {
    color: var(--purple);
    font-size: 13px;
}

.section-title,
.media-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.section-title {
    margin-bottom: 25px;
}

.section-title h2 {
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -.045em;
}

.section-title p,
.media-heading p {
    max-width: 620px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.editor-card {
    padding: 27px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(30, 28, 63, .05);
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
}

.step-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--purple);
    background: var(--purple-soft);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 900;
}

.card-heading h3,
.media-heading h3 {
    font-size: 17px;
}

.card-heading p {
    color: var(--muted);
    font-size: 10px;
}

.drop-zone {
    min-height: 160px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    margin-bottom: 23px;
    padding: 20px;
    background: #faf9fc;
    border: 1px dashed #bbb8c8;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
}

.drop-zone:hover {
    color: var(--purple);
    border-color: var(--purple);
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.upload-symbol {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 5px;
    color: var(--purple);
    background: var(--purple-soft);
    border-radius: 50%;
    font-weight: 900;
}

.drop-zone strong {
    font-size: 12px;
}

.drop-zone small {
    color: var(--muted);
    font-size: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 130px;
    gap: 17px;
    margin-bottom: 22px;
}

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

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

.switch-field {
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
}

.switch-field input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch {
    position: relative;
    width: 43px;
    height: 24px;
    flex: 0 0 43px;
    background: #c9c7cf;
    border-radius: 999px;
    transition: background .2s ease;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .15);
    transition: transform .2s ease;
}

.switch-field input:checked + .switch {
    background: var(--green);
}

.switch-field input:checked + .switch::after {
    transform: translateX(19px);
}

.switch-field > span:last-child {
    display: grid;
}

.switch-field strong {
    font-size: 11px;
}

.switch-field small {
    color: var(--muted);
    font-size: 9px;
}

.media-heading {
    margin: 42px 0 17px;
}

.media-heading > span {
    padding: 7px 11px;
    color: var(--purple);
    background: var(--purple-soft);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.media-list {
    display: grid;
    gap: 16px;
}

.media-editor {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.media-preview {
    position: relative;
    min-height: 260px;
    background: #e9e8ed;
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
}

.media-preview > span {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 6px 9px;
    color: var(--white);
    background: rgba(23, 24, 42, .75);
    border-radius: 8px;
    font-size: 9px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.media-editor form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
    padding: 21px;
}

.media-editor form > .field:first-of-type,
.media-editor form > .field:nth-of-type(2),
.media-options,
.media-actions {
    grid-column: 1 / -1;
}

.media-editor [data-media-file] {
    display: none;
}

.media-options {
    display: flex;
    align-items: end;
    gap: 20px;
}

.switch-field.small {
    min-height: 48px;
}

.order-field {
    width: 95px;
    margin-left: auto;
}

.media-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
}

.compact-button {
    min-height: 38px;
    margin-left: auto;
}

.empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: var(--muted);
    background: var(--white);
    border: 1px dashed #c8c5d1;
    border-radius: 17px;
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
    font-size: 13px;
}

.empty-state span {
    font-size: 11px;
}

.status-pill {
    padding: 8px 12px;
    color: var(--coral);
    background: #fff0ef;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.status-pill.active {
    color: var(--green);
    background: #e8f7f0;
}

.campaign-switch {
    margin-bottom: 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.form-actions > span {
    margin-right: auto;
    color: var(--muted);
    font-size: 10px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    max-width: min(380px, calc(100% - 48px));
    padding: 14px 18px;
    color: var(--white);
    background: var(--ink);
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: .25s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.toast.error {
    background: #a72a24;
}

.loading-layer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: var(--white);
    background: rgba(25, 23, 55, .72);
    backdrop-filter: blur(5px);
}

.loading-layer strong {
    font-size: 12px;
}

.spinner {
    width: 35px;
    height: 35px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
    .login-screen {
        grid-template-columns: 1fr;
    }

    .login-card {
        width: min(100%, 580px);
        min-height: 100vh;
        margin-inline: auto;
    }

    .login-visual {
        display: none;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 100;
        width: 255px;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .sidebar.open {
        transform: none;
        box-shadow: 20px 0 50px rgba(24, 22, 64, .22);
    }

    .panel-main {
        padding-inline: 28px;
    }

    .mobile-menu {
        display: grid;
        place-items: center;
    }
}

@media (max-width: 700px) {
    .login-card {
        padding: 110px 26px 45px;
    }

    .login-brand {
        top: 25px;
        left: 24px;
    }

    .panel-main {
        padding: 0 16px 50px;
    }

    .panel-header {
        min-height: 84px;
    }

    .admin-badge div {
        display: none;
    }

    .welcome-card {
        grid-template-columns: 1fr;
        padding: 30px 25px;
    }

    .welcome-mark {
        display: none;
    }

    .summary-grid,
    .quick-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .full-grid {
        grid-column: auto;
    }

    .media-editor {
        grid-template-columns: 1fr;
    }

    .media-preview {
        min-height: 235px;
    }

    .media-actions {
        flex-wrap: wrap;
    }

    .compact-button {
        width: 100%;
        margin-left: 0;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
