/* ============================================================
   LANDING PAGE - BRIEFING GOOGLE ADS
   Design Premium | Mobile First | Performance First
   Zero dependencias externas
   ============================================================ */

/* === VARIAVEIS === */
:root {
    /* Cores */
    --bg: #fafaf8;
    --bg-card: #ffffff;
    --bg-warm: #f5f5f0;
    --text: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;
    --accent: #1a5fb4;
    --accent-hover: #154a8c;
    --accent-light: #e8f0fe;
    --accent-soft: rgba(26, 95, 180, 0.08);
    --border: #d4d4d0;
    --border-focus: #1a5fb4;
    --success: #2d8a4e;
    --success-light: #e6f4ea;
    --error: #c0392b;
    --error-light: #fce8e6;

    /* Tipografia */
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", monospace;

    /* Espacamento */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 100px;

    /* Sombras suaves */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
    --shadow-focus: 0 0 0 3px var(--accent-light);

    /* Transicoes */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;

    /* Layout */
    --max-width: 560px;
    --input-height: 56px;
    --btn-height: 56px;
}

/* === UTILITARIOS === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.conditional {
    animation: fadeIn 0.3s ease;
}

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

/* === RESET LEVE === */
*, *::before, *::after {
    box-sizing: border-box;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

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

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* === TIPOGRAFIA BASE === */
body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* === FALLBACK - PROGRESS BAR (inline critical) === */
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--transition-base);
    width: 10%;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* === FALLBACK - SPINNER === */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === PROGRESS BAR === */
.progress-container {
    background: linear-gradient(180deg, var(--bg) 0%, rgba(250,250,248,0.95) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(212,212,208,0.5);
}

.progress-track {
    position: relative;
    overflow: hidden;
}

.progress-track::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* === WIZARD LAYOUT === */
.wizard-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: 80px;
}

/* === TEXTAREA WRAP (tooltip positioning) === */
.textarea-wrap {
    position: relative;
}

.textarea-wrap .tooltip-trigger {
    top: 16px;
    right: 16px;
    transform: none;
}

.textarea-wrap .tooltip-trigger:active {
    transform: scale(0.92);
}

/* === WIZARD === */
.wizard-form {
    padding-bottom: 60px;
}

/* === STEPS === */
.step-content {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    transition: all var(--transition-base);
}

.step-badge--success {
    background: var(--success-light);
    color: var(--success);
    width: 44px;
    height: 44px;
}

.step-title {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    color: var(--text);
}

.step-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* === FIELD GROUP === */
.field-group {
    margin-bottom: 28px;
}

.field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* === INPUTS === */
.input-wrap {
    position: relative;
    width: 100%;
}

.input-field {
    width: 100%;
    height: var(--input-height);
    padding: 0 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color var(--transition-base),
                box-shadow var(--transition-base),
                transform var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.input-field::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.input-field:hover {
    border-color: var(--text-muted);
}

.input-field:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-focus);
    transform: translateY(-1px);
}

/* Remover outline do Chrome */
.input-field:focus-visible {
    outline: none;
}

/* Input com erro */
.input-field.has-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-light);
}

.input-field.has-error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-light);
}

/* Textarea */
textarea.input-field {
    height: auto;
    min-height: 120px;
    padding: 16px 18px;
    resize: vertical;
    line-height: 1.6;
}

/* Input com prefixo de moeda */
.input-currency .currency-prefix {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 2;
}

.input-currency .input-with-prefix {
    padding-left: 44px;
}

/* === TOOLTIP === */
.tooltip-trigger {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus-visible {
    color: var(--accent);
    background: var(--accent-soft);
    outline: none;
}

.tooltip-trigger:active {
    transform: translateY(-50%) scale(0.92);
}

.tooltip-trigger[aria-expanded="true"] {
    color: var(--accent);
    background: var(--accent-soft);
}

/* Tooltip posicionado para textarea */
.tooltip-textarea {
    top: 20px;
    transform: none;
}

.tooltip-textarea:active {
    transform: scale(0.92);
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    right: -8px;
    background: var(--text);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    line-height: 1.5;
    max-width: 280px;
    width: max-content;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity var(--transition-base),
                visibility var(--transition-base),
                transform var(--transition-base);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 18px;
    border: 7px solid transparent;
    border-top-color: var(--text);
}

.tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Tooltip para textarea - posicionar abaixo */
textarea + .tooltip-trigger + .tooltip {
    bottom: auto;
    top: calc(100% + 10px);
    right: 0;
}

textarea + .tooltip-trigger + .tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--text);
}

/* === HINT E COUNTER === */
.hint-text {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.field-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 12px;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.char-counter.near-limit {
    color: var(--error);
    font-weight: 600;
}

/* === ERROR MESSAGE === */
.error-msg {
    display: none;
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: 8px;
    font-weight: 500;
    min-height: 1.3em;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.error-msg.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* === RADIO CARDS === */
.radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 4px;
}

.radio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 16px;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-card);
    -webkit-tap-highlight-color: transparent;
}

.radio-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.radio-card:active {
    transform: translateY(0) scale(0.98);
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card:has(input:focus-visible) {
    box-shadow: var(--shadow-focus);
    border-color: var(--accent);
}

.radio-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: var(--shadow-md);
}

.radio-icon {
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.radio-card:has(input:checked) .radio-icon {
    color: var(--accent);
}

.radio-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    transition: color var(--transition-base);
}

/* === CHECKBOX CHIPS === */
.chips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}

.chip {
    position: relative;
}

.chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
    background: var(--bg-card);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 46px;
}

.chip-label:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.chip input:focus-visible + .chip-label {
    box-shadow: var(--shadow-focus);
    border-color: var(--accent);
}

.chip input:checked + .chip-label {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.chip input:checked + .chip-label:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.chip input:active + .chip-label {
    transform: scale(0.96);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--btn-height);
    padding: 0 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    outline: none;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.01em;
}

.btn:focus-visible {
    box-shadow: var(--shadow-focus);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 95, 180, 0.25);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(26, 95, 180, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 4px rgba(26, 95, 180, 0.25);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-warm);
    border-color: var(--text-muted);
    color: var(--text);
}

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

.btn-submit {
    gap: 10px;
    font-size: 1rem;
    padding: 0 32px;
    background: var(--success);
    box-shadow: 0 2px 8px rgba(45, 138, 78, 0.3);
}

.btn-submit:hover {
    background: #247940;
    box-shadow: 0 4px 16px rgba(45, 138, 78, 0.4);
}

.btn-submit:active {
    box-shadow: 0 1px 4px rgba(45, 138, 78, 0.3);
}

/* === STEP ACTIONS === */
.step-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.step-actions .btn {
    width: 100%;
}

/* === SUMMARY === */
.summary-content {
    padding-bottom: 40px;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.summary-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    transition: all var(--transition-base);
}

.summary-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.summary-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    margin-top: 2px;
}

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

.summary-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.45;
    word-break: break-word;
}

.summary-edit {
    flex-shrink: 0;
    align-self: center;
}

.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-actions .btn {
    width: 100%;
}

/* === FOOTER === */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    border-top: 1px solid rgba(212,212,208,0.4);
}

/* === LOADING === */
.loading-overlay {
    flex-direction: column;
    gap: 20px;
}

.loading-overlay::after {
    content: 'Enviando seu briefing...';
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* === RESPONSIVIDADE === */

/* Tablet e acima */
@media (min-width: 640px) {
    .wizard-form {
        padding: 0 32px;
    }

    .step-title {
        font-size: 1.875rem;
    }

    .step-subtitle {
        font-size: 1.0625rem;
    }

    .chips-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .summary-actions {
        flex-direction: row;
        justify-content: space-between;
    }

    .summary-actions .btn-secondary {
        width: auto;
        order: 1;
    }

    .summary-actions .btn-submit {
        width: auto;
        order: 2;
    }
}

/* Desktop */
@media (min-width: 768px) {
    .wizard-form {
        padding: 0;
    }

    .step-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .step-actions .btn {
        width: auto;
        min-width: 160px;
    }

    .step-actions .btn-primary {
        order: 2;
        min-width: 200px;
    }

    .step-actions .btn-secondary {
        order: 1;
    }

    .radio-cards {
        gap: 16px;
    }

    .radio-card {
        padding: 32px 24px;
    }

    .summary-item {
        padding: 20px 24px;
    }
}

/* Telas grandes */
@media (min-width: 1024px) {
    :root {
        --max-width: 580px;
    }

    .step-title {
        font-size: 2rem;
    }
}

/* Reducao de movimento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .step {
        transition: none;
    }
}

/* Modo escuro do sistema - manter claro por enquanto */
@media (prefers-color-scheme: dark) {
    /* Mantendo o tema claro para consistencia */
}

/* === PRINT === */
@media print {
    .progress-container,
    .tooltip-trigger,
    .step-actions,
    .site-footer,
    .btn {
        display: none !important;
    }

    .step {
        opacity: 1 !important;
        position: relative !important;
        transform: none !important;
        pointer-events: all !important;
        page-break-inside: avoid;
    }
}

/* === ACESSIBILIDADE - FOCUS VISIBLE === */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .input-field {
        border-width: 2px;
    }

    .btn-primary {
        border: 2px solid #fff;
    }
}
