:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --bg: #0f0f13;
    --card: #1a1a22;
    --text: #f0f0f5;
    --muted: #a0a0b0;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --border: #2a2a35;
    --radius: 12px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
}

.logo span {
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav a, .nav button {
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav a:hover, .nav button:hover {
    color: var(--text);
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-whatsapp {
    background: #25D366;
    color: #000;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    color: #86efac;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid #3b82f6;
    color: #93c5fd;
}

/* Plans */
.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.plan-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.plan-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.plan-card h3 {
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.5rem 0 1rem;
}

.plan-card ul {
    list-style: none;
    margin-bottom: 1.25rem;
    text-align: left;
}

.plan-card ul li {
    padding: 0.35rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.plan-card ul li::before {
    content: "✓ ";
    color: var(--primary);
}

/* Media grid in dashboard */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.media-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.media-item .info {
    padding: 0.6rem;
    font-size: 0.8rem;
}

.media-item .info a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
}

.media-item .actions {
    display: flex;
    gap: 0.3rem;
    padding: 0 0.6rem 0.6rem;
}

/* Share box */
.share-box {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.share-box input {
    width: 100%;
    padding: 0.6rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Viewer (public carousel) – efeito baralho / cartas */
.viewer-body {
    margin: 0;
    background: #000;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    touch-action: none;
    perspective: 1200px;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform-origin: center center;
    transform-style: preserve-3d;
    will-change: transform, opacity;
    transition: none;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 5;
}

/* Carta saindo para a esquerda (próxima entra) */
.slide.exit-left {
    z-index: 6;
    animation: cardExitLeft 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Carta saindo para a direita */
.slide.exit-right {
    z-index: 6;
    animation: cardExitRight 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Nova carta entrando pela direita */
.slide.enter-from-right {
    z-index: 4;
    animation: cardEnterFromRight 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Nova carta entrando pela esquerda */
.slide.enter-from-left {
    z-index: 4;
    animation: cardEnterFromLeft 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes cardExitLeft {
    0% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-110%) rotateY(-28deg) scale(0.88);
    }
}

@keyframes cardExitRight {
    0% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(110%) rotateY(28deg) scale(0.88);
    }
}

@keyframes cardEnterFromRight {
    0% {
        opacity: 0;
        transform: translateX(70%) rotateY(22deg) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
    }
}

@keyframes cardEnterFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-70%) rotateY(-22deg) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
    }
}

.slide img,
.slide video {
    max-width: 94%;
    max-height: 88%;
    object-fit: contain;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    background: #111;
}

/* Arrasto ao vivo (seguir o dedo) */
.slide.dragging {
    transition: none !important;
    z-index: 10;
}

/* Botão de som caso o navegador bloqueie autoplay com áudio */
.sound-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 30;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 0.35rem;
    backdrop-filter: blur(6px);
}

.sound-btn.show {
    display: inline-flex;
}

.sound-btn:hover {
    background: rgba(37, 211, 102, 0.35);
}

/* Progress bar */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    width: 0%;
    z-index: 20;
    transition: width 0.1s linear;
}

.viewer-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 0.85rem;
}

.viewer-ui .dots {
    display: flex;
    gap: 6px;
}

.viewer-ui .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}

.viewer-ui .dot.active {
    background: var(--primary);
}

.hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.hint.show {
    opacity: 1;
}

/* Login / Register centered */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.auth-card .logo {
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--bg);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.stat-box .number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .label {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Empty state */
.empty {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 600px) {
    .header .container {
        flex-direction: column;
        gap: 0.5rem;
    }
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Relatórios ========== */
.report-stats {
    margin-bottom: 0.5rem;
}

.report-stat .sub {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 140px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.chart-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}

.chart-cols {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-height: 0;
}

.chart-col {
    width: 40%;
    max-width: 18px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.35s ease;
}

.chart-col.views {
    background: linear-gradient(180deg, #25D366, #128C7E);
}

.chart-col.clicks {
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.chart-label {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.chart-values {
    font-size: 0.65rem;
    color: var(--muted);
    opacity: 0.8;
}

.chart-legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.chart-legend .leg {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.chart-legend .leg.views {
    background: #25D366;
}

.chart-legend .leg.clicks {
    background: #3b82f6;
}

.media-report-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.media-report-item {
    display: flex;
    gap: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    align-items: flex-start;
}

.media-report-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #000;
}

.media-report-thumb img,
.media-report-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-report-body {
    flex: 1;
    min-width: 0;
}

.media-report-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.media-report-title .badge {
    font-size: 0.7rem;
    background: var(--border);
    color: var(--muted);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.media-report-url {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.media-report-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.metric-num {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.metric-lbl {
    font-size: 0.72rem;
    color: var(--muted);
}

.mini-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 0.3rem;
    overflow: hidden;
}

.mini-bar span {
    display: block;
    height: 100%;
    border-radius: 2px;
    min-width: 0;
}

.mini-bar span.views {
    background: #25D366;
}

.mini-bar span.clicks {
    background: #3b82f6;
}

@media (max-width: 600px) {
    .media-report-item {
        flex-direction: column;
    }
    .media-report-thumb {
        width: 100%;
        height: 120px;
    }
}

/* CTA "Clique na mídia..." após 10s */
.media-cta {
    position: absolute;
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%) translateY(12px);
    z-index: 25;
    max-width: calc(100% - 2rem);
    padding: 0.65rem 1.1rem;
    background: #000;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.media-cta.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.media-cta.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
}

/* Slide promocional (plano free) */
.slide-promo {
    background: radial-gradient(ellipse at top, #1a2e1a 0%, #0a0a0c 55%, #000 100%);
}

.promo-card {
    width: min(92%, 380px);
    margin: 0 auto;
    padding: 1.75rem 1.5rem 1.5rem;
    background: linear-gradient(160deg, #1a1a22 0%, #121218 100%);
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.promo-card:active {
    transform: scale(0.98);
}

.promo-icons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.promo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 14px;
}

.promo-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
    line-height: 1.25;
}

.promo-text {
    font-size: 0.9rem;
    color: #a0a0b0;
    line-height: 1.45;
    margin-bottom: 1rem;
}

.promo-features {
    list-style: none;
    text-align: left;
    margin: 0 auto 1.25rem;
    max-width: 260px;
    padding: 0;
}

.promo-features li {
    font-size: 0.88rem;
    color: #d0d0d8;
    padding: 0.35rem 0;
}

.promo-cta {
    display: inline-block;
    background: #25D366;
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    margin-bottom: 0.85rem;
}

.promo-brand {
    font-size: 0.8rem;
    color: #25D366;
    font-weight: 600;
    letter-spacing: 0.02em;
}
