/* ============================================
   PUBLISH AUDIT v2 - dark/light + foto CEO
   ============================================ */

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

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

:root,
[data-theme="dark"] {
    --bg-deep: #0A0E1A;
    --bg-card: #0F1420;
    --bg-card-light: #141A2B;
    --blue-primary: #3B9EFF;
    --blue-hover: #2080E5;
    --blue-light: #7BB8FF;
    --grid-line: #1A2238;
    --white: #FFFFFF;
    --text-main: #FFFFFF;
    --text-secondary: #B8BFD0;
    --text-muted: #8B92A5;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --error: #FF5252;
    --quote-bg: rgba(255, 255, 255, 0.04);
    --tag-bg: rgba(59, 158, 255, 0.1);
    --tag-border: rgba(59, 158, 255, 0.3);
}

[data-theme="light"] {
    --bg-deep: #F7F9FC;
    --bg-card: #FFFFFF;
    --bg-card-light: #F0F4F9;
    --blue-primary: #1A8CFF;
    --blue-hover: #0F6FD1;
    --blue-light: #1A8CFF;
    --grid-line: #E4E9F2;
    --text-main: #0A1628;
    --text-secondary: #4A5568;
    --text-muted: #6B7280;
    --border: rgba(10, 22, 40, 0.08);
    --border-strong: rgba(10, 22, 40, 0.15);
    --error: #DC2626;
    --quote-bg: rgba(26, 140, 255, 0.05);
    --tag-bg: rgba(26, 140, 255, 0.08);
    --tag-border: rgba(26, 140, 255, 0.25);
}

:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
    background: var(--bg-deep);
    font-family: var(--font);
    color: var(--text-main);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.audit-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ===== LADO ESQUERDO ===== */
.audit-left {
    flex: 1;
    background: var(--bg-deep);
    position: relative;
    padding: 200px 60px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    transition: background 0.3s var(--ease);
}

.audit-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.4;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
}

.audit-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(59, 158, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

[data-theme="light"] .audit-left::after {
    background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(26, 140, 255, 0.08) 0%, transparent 70%);
}

.left-content {
    position: relative;
    z-index: 2;
    max-width: 540px;
    transition: max-width 0.4s var(--ease);
}

.left-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--blue-light);
    margin-bottom: 32px;
}

[data-theme="light"] .left-tag { color: var(--blue-primary); }

.left-headline {
    font-size: clamp(40px, 4.5vw, 64px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 24px;
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.left-headline .highlight { color: var(--blue-primary); }

.left-subline {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 460px;
    transition: opacity 0.4s var(--ease) 0.1s;
}

/* ===== FOTO CEO (desktop - lateral direita) ===== */
.ceo-hero.ceo-desktop {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 95%;
    max-height: 820px;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

.ceo-hero.ceo-mobile {
    display: none;
}

.audit-left.show-ceo .ceo-desktop { opacity: 1; }
.audit-left.show-ceo .left-content { max-width: 480px; }

[data-theme="light"] .ceo-hero {
    filter: drop-shadow(0 20px 40px rgba(10, 22, 40, 0.25));
}

/* ===== STATS / DEPOIMENTOS ===== */
.left-proof {
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 2;
    max-width: 540px;
}

.left-stats {
    display: flex;
    gap: 48px;
    margin-bottom: 24px;
}

.stat-item .stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.stat-item .stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-top: 4px;
}

.left-quote {
    background: var(--quote-bg);
    border-left: 3px solid var(--blue-primary);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    transition: opacity 0.5s var(--ease) 0.2s;
}

.left-quote .quote-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
}

.left-quote .quote-author {
    font-size: 12px;
    color: var(--blue-light);
    font-weight: 500;
}

[data-theme="light"] .left-quote .quote-author { color: var(--blue-primary); }

/* ===== LOGO ===== */
.left-logo-link {
    position: absolute;
    top: 24px;
    left: 40px;
    z-index: 3;
    display: inline-block;
    transition: opacity 0.2s var(--ease);
}

.left-logo-link:hover { opacity: 0.85; }

.left-logo-img {
    height: 240px;
    width: auto;
    display: block;
}

/* ===== LADO DIREITO ===== */
.audit-right {
    flex: 1;
    background: var(--bg-card);
    position: relative;
    padding: 80px 80px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: background 0.3s var(--ease);
}

.right-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 60px;
    gap: 16px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-back:hover { background: var(--bg-card-light); color: var(--text-main); }
.btn-back svg { width: 20px; height: 20px; }
.btn-back:disabled { opacity: 0.3; cursor: not-allowed; }

/* Theme toggle */
.theme-toggle {
    background: var(--bg-card-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: all 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-deep);
    color: var(--blue-primary);
    border-color: var(--blue-primary);
}

.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-primary), var(--blue-light));
    border-radius: 999px;
    transition: width 0.4s var(--ease);
    width: 10%;
}

.progress-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.form-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.step {
    display: none;
    animation: stepIn 0.4s var(--ease) forwards;
}

.step.active { display: block; }

@keyframes stepIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-pre {
    font-size: 14px;
    color: var(--blue-light);
    font-weight: 500;
    margin-bottom: 8px;
}

[data-theme="light"] .step-pre { color: var(--blue-primary); }

.step-question {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 32px;
    letter-spacing: -0.01em;
}

.input-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.audit-input,
.audit-select,
.audit-textarea {
    width: 100%;
    padding: 18px 20px;
    background: var(--bg-card-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 400;
    outline: none;
    transition: all 0.2s var(--ease);
}

.audit-input::placeholder,
.audit-textarea::placeholder { color: var(--text-muted); }

.audit-input:focus,
.audit-select:focus,
.audit-textarea:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 4px rgba(59, 158, 255, 0.1);
}

[data-theme="light"] .audit-input:focus,
[data-theme="light"] .audit-select:focus,
[data-theme="light"] .audit-textarea:focus {
    box-shadow: 0 0 0 4px rgba(26, 140, 255, 0.1);
}

.audit-textarea {
    resize: vertical;
    min-height: 140px;
    font-family: var(--font);
}

.audit-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238B92A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 48px;
    cursor: pointer;
}

.audit-select option { background: var(--bg-card); color: var(--text-main); }

.toggle-tipo {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg-card-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: fit-content;
}

.toggle-tipo button {
    background: none;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s var(--ease);
}

.toggle-tipo button.active {
    background: var(--blue-primary);
    color: var(--white);
}

.input-error {
    color: var(--error);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.input-error.show { display: block; }

.step-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
}

.btn-prosseguir {
    background: var(--blue-primary);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s var(--ease);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-prosseguir:hover {
    background: var(--blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 158, 255, 0.3);
}

.btn-prosseguir:active { transform: translateY(0); }
.btn-prosseguir:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-prosseguir svg { width: 16px; height: 16px; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-prosseguir.loading .spinner { display: inline-block; }
.btn-prosseguir.loading .btn-text,
.btn-prosseguir.loading svg.arrow { display: none; }

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

.right-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.right-footer a { color: var(--blue-light); text-decoration: none; }
[data-theme="light"] .right-footer a { color: var(--blue-primary); }
.right-footer a:hover { text-decoration: underline; }

/* ============================================
   MOBILE - estilo V4 simplificado
   Esconde lado esquerdo inteiro, mostra so:
   header (logo + back) + pergunta + input + depoimento
   ============================================ */
@media (max-width: 1024px) {
    html, body {
        overflow: auto;
        height: auto;
        background: var(--bg-card); /* fundo branco no mobile (light) ou bg-card no dark */
    }

    .audit-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* Lado esquerdo VIRA o header simplificado */
    .audit-left {
        flex: none;
        background: transparent;
        padding: 24px 24px 0;
        min-height: auto;
        overflow: visible;
    }

    /* Esconde TUDO do lado esquerdo no mobile, exceto a logo */
    .audit-left::before,
    .audit-left::after { display: none; }

    .audit-left .left-content,
    .audit-left .left-proof,
    .audit-left .ceo-hero,
    .audit-left .ceo-desktop,
    .audit-left .ceo-mobile {
        display: none !important;
    }

    /* Logo fica em posicao normal no header */
    .left-logo-link {
        position: static;
        display: block;
        margin: 0 auto 8px;
        text-align: center;
    }

    .left-logo-img {
        height: 80px;
        margin: 0 auto;
    }

    /* Lado direito = forms principal */
    .audit-right {
        flex: 1;
        padding: 24px 24px 32px;
        background: var(--bg-card);
    }

    .right-header {
        margin-bottom: 32px;
        gap: 12px;
    }

    /* Toggle tema some no mobile - simplifica igual V4 */
    .theme-toggle { display: none; }

    .step-pre {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .step-question {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 24px;
    }

    .audit-input,
    .audit-select,
    .audit-textarea {
        font-size: 16px; /* evita zoom iOS */
        padding: 16px 18px;
    }

    .step-actions {
        margin-top: 24px;
    }

    .btn-prosseguir {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
    }

    /* Depoimento aparece DENTRO do form-content, depois do botao */
    .mobile-quote {
        display: block;
        margin-top: 32px;
        background: var(--quote-bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 20px;
        position: relative;
    }

    .mobile-quote::before {
        content: '"';
        position: absolute;
        top: 8px;
        left: 18px;
        font-size: 48px;
        color: var(--blue-primary);
        font-family: Georgia, serif;
        line-height: 1;
        font-weight: 700;
    }

    .mobile-quote .mobile-quote-text {
        font-size: 15px;
        line-height: 1.5;
        color: var(--text-secondary);
        font-style: italic;
        margin: 24px 0 12px;
    }

    .mobile-quote .mobile-quote-author {
        background: var(--tag-bg);
        margin: -20px -20px 0;
        padding: 12px 20px;
        font-size: 13px;
        color: var(--blue-primary);
        font-weight: 500;
        border-radius: 0 0 12px 12px;
    }
}

/* Mobile pequeno - so ajusta padding e tamanhos */
@media (max-width: 480px) {
    .audit-left { padding: 20px 20px 0; }
    .audit-right { padding: 20px 20px 28px; }
    .left-logo-img { height: 70px; }
    .step-question { font-size: 22px; }
    .right-header { margin-bottom: 24px; }
}

/* Desktop - garante que mobile-quote nunca aparece */
@media (min-width: 1025px) {
    .mobile-quote { display: none !important; }
}
