/* ═══════════════════════════════════════════════════════════════════════════
   KX MÍDIA - OFERTAS  ·  Design System
   Gerador de Prompts para IA · Dark Mode Premium
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
    /* Brand */
    --brand-primary: #6C5CE7;
    --brand-secondary: #A29BFE;
    --brand-accent: #00CECE;
    --brand-glow: rgba(108, 92, 231, .35);

    /* Surfaces */
    --bg-body: #0B0D17;
    --bg-card: rgba(20, 22, 40, .65);
    --bg-card-border: rgba(108, 92, 231, .18);
    --bg-input: rgba(15, 17, 32, .7);
    --bg-input-focus: rgba(20, 22, 44, .9);
    --glass-blur: 18px;

    /* Text */
    --text-primary: #F0F0F5;
    --text-secondary: rgba(240, 240, 245, .72);
    --text-muted: rgba(240, 240, 245, .42);

    /* Status */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-out: cubic-bezier(.22, 1, .36, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Background decoration */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 10%, rgba(108, 92, 231, .12) 0%, transparent 60%),
        radial-gradient(ellipse 500px 350px at 80% 80%, rgba(0, 206, 206, .08) 0%, transparent 60%),
        radial-gradient(ellipse 800px 600px at 50% 50%, rgba(108, 92, 231, .04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Header / Hero ─────────────────────────────────────────────────────── */
.kx-header {
    position: relative;
    text-align: center;
    padding: 56px 24px 40px;
    background:
        linear-gradient(180deg, rgba(108, 92, 231, .10) 0%, transparent 100%);
    border-bottom: 1px solid rgba(108, 92, 231, .10);
    z-index: 1;
}

.kx-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(108, 92, 231, .12);
    border: 1px solid rgba(108, 92, 231, .25);
    color: var(--brand-secondary);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 20px;
    animation: fadeInDown .6s var(--ease-out);
}

.kx-brand {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1.1;
    animation: fadeInUp .7s var(--ease-out);
}

.kx-brand span {
    background: linear-gradient(135deg, var(--brand-accent), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kx-brand-sub {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
    margin-top: 4px;
    animation: fadeInUp .8s var(--ease-out);
}

.kx-subtitle {
    font-size: clamp(.88rem, 1.8vw, 1.05rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 16px auto 0;
    line-height: 1.6;
    animation: fadeInUp .9s var(--ease-out);
}

/* ─── Container ─────────────────────────────────────────────────────────── */
.kx-container {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ─── Cards (Glass) ─────────────────────────────────────────────────────── */
.kx-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 24px;
    transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}

.kx-card:hover {
    border-color: rgba(108, 92, 231, .32);
    box-shadow: 0 0 30px rgba(108, 92, 231, .06);
}

.kx-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.kx-card-title i {
    font-size: 1.15rem;
    color: var(--brand-accent);
}

/* ─── Carousel ──────────────────────────────────────────────────────────── */
.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 8px 4px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex: 0 0 280px;
    scroll-snap-align: center;
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 3px solid transparent;
    transition: all .35s var(--ease-out);
    background: rgba(15, 17, 32, .5);
}

.carousel-item:hover {
    border-color: rgba(108, 92, 231, .4);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(108, 92, 231, .15);
}

.carousel-item.selected {
    border-color: var(--brand-primary);
    box-shadow: 0 0 20px var(--brand-glow), 0 12px 32px rgba(108, 92, 231, .2);
}

.carousel-item.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    z-index: 3;
    animation: scaleIn .3s var(--ease-out);
}

.carousel-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.carousel-item-label {
    padding: 12px 14px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    background: rgba(15, 17, 32, .8);
}

.carousel-item-label small {
    display: block;
    font-size: .7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Carousel navigation arrows */
.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(108, 92, 231, .3);
    background: rgba(20, 22, 40, .7);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all .25s var(--ease-out);
}

.carousel-btn:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    transform: scale(1.08);
}

/* ─── Form Elements ─────────────────────────────────────────────────────── */
.kx-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
}

.kx-label .optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    font-size: .72rem;
}

.kx-input,
.kx-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid rgba(108, 92, 231, .15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .9rem;
    transition: all .25s var(--ease-out);
    outline: none;
}

.kx-input::placeholder {
    color: var(--text-muted);
}

.kx-input:focus,
.kx-select:focus {
    background: var(--bg-input-focus);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.kx-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(240,240,245,.5)' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.kx-select option {
    background: #14162a;
    color: var(--text-primary);
}

/* ─── Product Row ───────────────────────────────────────────────────────── */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-row {
    display: grid;
    grid-template-columns: 1fr 120px 90px 40px;
    gap: 8px;
    align-items: center;
    animation: fadeInUp .3s var(--ease-out);
}

.product-row .kx-input {
    padding: 10px 12px;
    font-size: .85rem;
}

.product-row .kx-select {
    padding: 10px 28px 10px 10px;
    font-size: .82rem;
}

.btn-remove-product {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(239, 68, 68, .25);
    background: rgba(239, 68, 68, .08);
    color: var(--error);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    transition: all .25s var(--ease-out);
}

.btn-remove-product:hover {
    background: rgba(239, 68, 68, .2);
    border-color: rgba(239, 68, 68, .5);
    transform: scale(1.05);
}

.btn-remove-product:disabled {
    opacity: .3;
    pointer-events: none;
}

.btn-add-product {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 18px;
    background: rgba(108, 92, 231, .1);
    border: 1px dashed rgba(108, 92, 231, .35);
    border-radius: var(--radius-sm);
    color: var(--brand-secondary);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s var(--ease-out);
}

.btn-add-product:hover {
    background: rgba(108, 92, 231, .18);
    border-color: rgba(108, 92, 231, .5);
}

.btn-add-product:disabled {
    opacity: .4;
    pointer-events: none;
}

.product-counter {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ─── Form Grid ─────────────────────────────────────────────────────────── */
.kx-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

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

/* ─── Generate Button ───────────────────────────────────────────────────── */
.btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--brand-primary), #8B5CF6);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all .35s var(--ease-out);
    box-shadow: 0 6px 24px rgba(108, 92, 231, .3);
}

.btn-generate::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .5s var(--ease-out);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(108, 92, 231, .4);
}

.btn-generate:hover::before {
    transform: translateX(100%);
}

.btn-generate:active {
    transform: translateY(0);
}

/* ─── Result Section ────────────────────────────────────────────────────── */
.kx-result {
    display: none;
    animation: fadeInUp .6s var(--ease-out);
}

.kx-result.visible {
    display: block;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(16, 185, 129, .25);
    color: var(--success);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.result-subtitle {
    color: var(--text-secondary);
    font-size: .92rem;
    margin-bottom: 24px;
}

/* Prompt Output */
.prompt-output-wrap {
    position: relative;
    background: rgba(10, 12, 24, .8);
    border: 1px solid rgba(108, 92, 231, .2);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.prompt-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(108, 92, 231, .08);
    border-bottom: 1px solid rgba(108, 92, 231, .15);
}

.prompt-output-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--brand-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--brand-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s var(--ease-out);
}

.btn-copy:hover {
    background: #7C6FE7;
    transform: scale(1.03);
}

.btn-copy.copied {
    background: var(--success);
}

.prompt-output-text {
    padding: 18px;
    font-family: 'Inter', monospace;
    font-size: .84rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.prompt-output-text::-webkit-scrollbar {
    width: 6px;
}

.prompt-output-text::-webkit-scrollbar-track {
    background: transparent;
}

.prompt-output-text::-webkit-scrollbar-thumb {
    background: rgba(108, 92, 231, .25);
    border-radius: 3px;
}

/* ─── Steps / Tutorial ──────────────────────────────────────────────────── */
.steps-section {
    margin-top: 28px;
}

.steps-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.step-card {
    background: rgba(20, 22, 40, .5);
    border: 1px solid rgba(108, 92, 231, .12);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    transition: all .3s var(--ease-out);
}

.step-card:hover {
    border-color: rgba(108, 92, 231, .3);
    transform: translateY(-2px);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    font-weight: 800;
    color: white;
    margin: 0 auto 12px;
}

.step-icon {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.step-text {
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── Action Buttons ────────────────────────────────────────────────────── */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-new-prompt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: rgba(108, 92, 231, .12);
    border: 1px solid rgba(108, 92, 231, .3);
    border-radius: var(--radius-md);
    color: var(--brand-secondary);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s var(--ease-out);
}

.btn-new-prompt:hover {
    background: rgba(108, 92, 231, .2);
    border-color: rgba(108, 92, 231, .5);
    transform: translateY(-1px);
}

/* ─── Alert ─────────────────────────────────────────────────────────────── */
.kx-alert {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.kx-alert.visible {
    display: flex;
}

.kx-alert-error {
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .25);
    color: #FCA5A5;
}

.kx-alert-warning {
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .25);
    color: #FCD34D;
}

/* ─── Field Error ───────────────────────────────────────────────────────── */
.field-error {
    font-size: .72rem;
    color: var(--error);
    font-weight: 500;
    margin-top: 4px;
    min-height: 0;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.kx-footer {
    text-align: center;
    padding: 28px 20px;
    color: var(--text-muted);
    font-size: .78rem;
    border-top: 1px solid rgba(108, 92, 231, .08);
    position: relative;
    z-index: 1;
}

.kx-footer strong {
    color: var(--text-secondary);
}

/* ─── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .kx-header {
        padding: 40px 16px 32px;
    }

    .kx-container {
        padding: 20px 14px 48px;
    }

    .kx-card {
        padding: 22px 16px;
    }

    .carousel-item {
        flex: 0 0 240px;
    }

    .product-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px;
        background: rgba(15, 17, 32, .4);
        border: 1px solid rgba(108, 92, 231, .1);
        border-radius: var(--radius-sm);
    }

    .product-row .btn-remove-product {
        justify-self: end;
    }

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

    .steps-grid {
        grid-template-columns: 1fr 1fr;
    }

    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .carousel-item {
        flex: 0 0 200px;
    }

    .carousel-item img {
        height: 140px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Tooltip ───────────────────────────────────────────────────────────── */
.kx-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 206, 206, .06);
    border: 1px solid rgba(0, 206, 206, .15);
    border-radius: var(--radius-sm);
    font-size: .78rem;
    color: rgba(0, 206, 206, .85);
    margin-top: 12px;
    line-height: 1.5;
}

.kx-tip i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ─── Example Button ────────────────────────────────────────────────────── */
.btn-example {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 206, 206, .08);
    border: 1px solid rgba(0, 206, 206, .2);
    border-radius: var(--radius-sm);
    color: var(--brand-accent);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s var(--ease-out);
}

.btn-example:hover {
    background: rgba(0, 206, 206, .15);
    border-color: rgba(0, 206, 206, .35);
}

/* ─── Logo reminder ─────────────────────────────────────────────────────── */
.logo-reminder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, .08), rgba(245, 158, 11, .04));
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.logo-reminder-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.logo-reminder-text {
    font-size: .85rem;
    color: #FCD34D;
    font-weight: 500;
    line-height: 1.5;
}

.logo-reminder-text strong {
    color: #FBBF24;
}

/* ─── Campaign Title Field ──────────────────────────────────────────────── */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    font-size: 1.15rem;
    color: var(--brand-accent);
    pointer-events: none;
    z-index: 2;
}

.kx-input-lg {
    padding: 14px 16px 14px 48px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
    border-color: rgba(108, 92, 231, .3) !important;
    transition: all .3s var(--ease-out) !important;
    text-transform: uppercase;
}

.kx-input-lg:focus {
    border-color: var(--brand-accent) !important;
    box-shadow: 0 0 0 3px rgba(0, 206, 206, .25) !important;
}

.kx-field-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: .8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.kx-field-hint i {
    color: var(--brand-secondary);
    font-size: .95rem;
    flex-shrink: 0;
}

@keyframes titlePulse {
    0% { transform: scale(1); background: var(--bg-input); }
    50% { transform: scale(1.01); background: rgba(108, 92, 231, .25); border-color: var(--brand-accent); }
    100% { transform: scale(1); background: var(--bg-input); }
}

.title-pulsing {
    animation: titlePulse .45s var(--ease-out);
}

