/* SMM Studio — рабочая зона поверх theme.css */

.smm-page {
    min-height: 100vh;
    background: var(--bg, #0a0a0d);
    color: var(--text, #f3f4f6);
}

/* ── Password gate ── */

.smm-login-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.smm-login-screen__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(245, 158, 11, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(251, 146, 60, 0.08), transparent 50%),
        var(--bg, #0a0a0d);
}

.smm-login {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 36px 32px 32px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.smm-login__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
}

.smm-login__brand .topbar-brand__mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    font-weight: 800;
    font-size: 1rem;
    color: #111;
}

.smm-login__brand .topbar-brand__text {
    font-weight: 700;
    font-size: 1.05rem;
}

.smm-login h1 {
    margin: 12px 0 8px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.smm-login > p {
    color: var(--muted, #9ca3af);
    font-size: 0.92rem;
    margin: 0 0 24px;
    line-height: 1.5;
}

.smm-login__submit {
    width: 100%;
    margin-top: 16px;
}

.smm-login__hint {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.82rem;
}

.smm-login__hint a {
    color: var(--muted, #9ca3af);
    text-decoration: none;
}

.smm-login__hint a:hover {
    color: #fbbf24;
}

/* ── Shared ── */

.smm-hidden {
    display: none !important;
}

.smm-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.smm-main {
    padding-bottom: 48px;
}

/* ── Auth gate ── */

.smm-auth-gate {
    margin: 0 0 20px;
    padding: 14px 18px;
    border-radius: var(--radius-sm, 12px);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.smm-auth-gate__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.smm-auth-gate__inner p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    flex: 1 1 220px;
}

body.smm-scena-auth .smm-auth-gate {
    display: none !important;
}

body:not(.smm-scena-auth) .smm-panel .btn-generate,
body:not(.smm-scena-auth) .smm-panel--text .btn-primary,
body:not(.smm-scena-auth) .smm-packages__grid .package-card__buy {
    opacity: 0.55;
    pointer-events: none;
}

/* ── Hero ── */

.smm-hero {
    padding: 28px 0 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 28px;
}

.smm-hero__title {
    margin: 14px 0 10px;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.smm-hero__lead {
    max-width: 720px;
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--muted, #9ca3af);
}

.smm-hero__lead strong {
    color: #fde68a;
    font-weight: 600;
}

.smm-balances {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0 32px;
    max-width: 520px;
}

.smm-balance-card {
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.smm-balance-card--accent {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.12), rgba(234, 88, 12, 0.06));
    border-color: rgba(245, 158, 11, 0.28);
}

.smm-balance-card__label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted, #9ca3af);
    margin-bottom: 6px;
}

.smm-balance-card__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.smm-balance-card--accent .smm-balance-card__value {
    color: #fbbf24;
}

.smm-balance-card__hint {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: rgba(156, 163, 175, 0.85);
}

/* ── Packages ── */

.smm-packages__title {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
}

.smm-packages__sub {
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: var(--muted, #9ca3af);
}

.smm-packages__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.smm-packages__grid .package-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px 16px 16px;
    transition: border-color 0.2s, transform 0.2s;
}

.smm-packages__grid .package-card:hover {
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

.smm-packages__grid .package-card.is-hit,
.smm-packages__grid .package-card.is-value {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12) inset;
}

.smm-packages__grid .pkg-scenes {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 8px 0 4px;
}

.smm-packages__grid .pkg-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fbbf24;
}

.smm-packages__grid .pkg-tagline {
    font-size: 0.78rem;
    color: var(--muted, #9ca3af);
    margin: 6px 0 12px;
    min-height: 2.4em;
}

.smm-packages__grid .package-card__buy {
    width: 100%;
}

/* ── Workspace ── */

.smm-workspace {
    margin-bottom: 40px;
}

.smm-workspace__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.smm-panel {
    min-height: 200px;
}

.smm-panel__head {
    margin-bottom: 4px;
}

.smm-panel--photo .btn-generate {
    width: 100%;
    margin-top: 18px;
}

.smm-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 18px;
}

.smm-option-field {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.smm-option-field__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: rgba(245, 158, 11, 0.85);
}

.smm-option-field__hint {
    margin: 10px 0 0;
    font-size: 0.78rem;
}

.smm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.smm-chip-row .chip {
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text, #f3f4f6);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
}

.smm-chip-row .chip:hover:not(.is-disabled):not(:disabled) {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}

.smm-chip-row .chip.is-active {
    border-color: rgba(251, 146, 60, 0.75);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(234, 88, 12, 0.14));
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2) inset, 0 8px 24px rgba(245, 158, 11, 0.12);
    color: #fff;
}

.smm-chip-row .chip.is-disabled,
.smm-chip-row .chip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

@media (min-width: 720px) {
    .smm-field-grid--split {
        grid-template-columns: 1fr 1fr;
    }
}

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

.smm-field-grid label {
    display: block;
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: var(--muted, #9ca3af);
}

.smm-field-grid input[type="text"],
.smm-field-grid input[type="number"],
.smm-field-grid select,
.smm-field-grid textarea {
    width: 100%;
    box-sizing: border-box;
}

.smm-field-grid textarea {
    min-height: 72px;
    resize: vertical;
}

.smm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.smm-check input {
    width: auto;
}

.smm-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.smm-ref-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.smm-ref-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.smm-ref-thumb button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

/* ── Preview (inside photo panel) ── */

.smm-preview {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.smm-preview__idle .preview-placeholder {
    padding: 32px 16px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted, #9ca3af);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.smm-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.smm-result-card {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.smm-result-card__media {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    padding: 10px 12px 0;
}

.smm-result-card img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(62vh, 780px);
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.smm-result-card__meta {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--muted, #9ca3af);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.smm-result-card__actions {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.smm-expiry {
    font-size: 0.78rem;
    color: var(--muted, #9ca3af);
    margin-top: 8px;
}

.smm-progress {
    margin-top: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.smm-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    transition: width 0.35s ease-out;
}

/* ── Text prompts ── */

.smm-panel--text .btn-primary {
    width: 100%;
    margin-top: 4px;
}

.smm-text-result {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.smm-text-result__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.smm-text-result__head label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted, #9ca3af);
}

.smm-text-result__box {
    width: 100%;
    box-sizing: border-box;
    min-height: 180px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: rgba(0, 0, 0, 0.35);
    color: inherit;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.55;
    resize: vertical;
}

/* ── Recent carousel ── */

.smm-recent {
    padding-top: 8px;
}

.smm-recent__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.smm-recent__title {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 700;
}

.smm-recent__sub {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted, #9ca3af);
}

.smm-recent__warning {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.smm-recent__warning-icon {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.smm-recent__warning p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #fecaca;
}

.smm-recent__warning strong {
    color: #fca5a5;
}

.smm-carousel-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0 -4px;
    padding: 4px 0;
}

.smm-carousel-wrap::before,
.smm-carousel-wrap::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 20px;
    width: 28px;
    z-index: 2;
    pointer-events: none;
}

.smm-carousel-wrap::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg, #0a0a0d) 0%, transparent 100%);
}

.smm-carousel-wrap::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg, #0a0a0d) 0%, transparent 100%);
}

.smm-carousel {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding: 4px;
    padding: 8px 4px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.4) transparent;
}

.smm-carousel::-webkit-scrollbar {
    height: 6px;
}

.smm-carousel::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.4);
    border-radius: 999px;
}

.smm-carousel__empty {
    flex: 1 0 auto;
    min-width: 100%;
    text-align: center;
    padding: 32px 16px;
}

.smm-carousel__item {
    flex: 0 0 200px;
    width: 200px;
    scroll-snap-align: start;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s, transform 0.2s;
}

.smm-carousel__item:hover {
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

.smm-carousel__thumb {
    position: relative;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.4);
    cursor: zoom-in;
}

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

.smm-carousel__meta {
    padding: 10px 12px;
}

.smm-carousel__prompt {
    margin: 0 0 8px;
    font-size: 0.72rem;
    color: var(--muted, #9ca3af);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smm-carousel__dl {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.78rem;
    padding: 7px 10px;
}

/* ── Lightbox ── */

.smm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
}

.smm-lightbox img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.smm-lightbox__hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

/* ── Responsive ── */

@media (max-width: 960px) {
    .smm-workspace__grid {
        grid-template-columns: 1fr;
    }

    .smm-packages__grid {
        grid-template-columns: 1fr;
    }

    .smm-balances {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .smm-field-grid {
        grid-template-columns: 1fr;
    }

    .smm-login {
        padding: 28px 22px 24px;
    }

    .smm-carousel__item {
        width: 168px;
    }

    .smm-auth-gate__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .smm-auth-gate__inner .btn {
        width: 100%;
    }
}

@media (min-width: 961px) and (max-width: 1100px) {
    .smm-packages__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
