/* ═══════════════════════════════════════════
   Captação de Necessidades — Stylesheet
   Accent: #2563EB (professional blue)
   ═══════════════════════════════════════════ */

:root {
    --accent: #2563EB;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --bg: #ffffff;
    --bg-section: #f9fafb;
    --border: #e5e7eb;
    --border-focus: #2563EB;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --success: #059669;
    --success-bg: #ecfdf5;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Header ─────────────────────────────── */

.header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

/* ─── Main ───────────────────────────────── */

.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 1rem;
}

.container {
    max-width: 580px;
    margin: 0 auto;
}

/* ─── Form intro ─────────────────────────── */

.form-intro {
    margin-bottom: 2rem;
}

.intro-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.intro-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ─── Form sections ──────────────────────── */

.form-section {
    margin-bottom: 1.5rem;
}

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

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.section-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    display: block;
}

.required {
    color: var(--error);
}

/* ─── Inputs ─────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-lighter);
}

.input-error {
    border-color: var(--error) !important;
}

.field-error {
    display: block;
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ─── Phone group ────────────────────────── */

.phone-group {
    display: flex;
    gap: 0.5rem;
}

.phone-prefix {
    width: 130px;
    flex-shrink: 0;
}

.phone-input {
    flex: 1;
}

/* ─── Necessidade principal ──────────────── */

.necessidade-principal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--accent-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
}

.necessidade-icon {
    font-size: 1.5rem;
}

.necessidade-nome {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

/* ─── Recommendations grid ───────────────── */

.recomendacoes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

@media (max-width: 560px) {
    .recomendacoes-grid {
        grid-template-columns: 1fr;
    }
}

.recomendacao-item {
    display: block;
    cursor: pointer;
}

.recomendacao-item input[type="checkbox"] {
    display: none;
}

.recomendacao-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.15s;
    background: var(--bg);
}

.recomendacao-item:hover .recomendacao-content {
    border-color: var(--accent);
    background: var(--accent-light);
}

.recomendacao-item input[type="checkbox"]:checked + .recomendacao-content {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.recomendacao-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.recomendacao-nome {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

/* ─── Consent ────────────────────────────── */

.consent-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.consent-label {
    display: flex;
    gap: 0.75rem;
    cursor: pointer;
    align-items: flex-start;
}

.consent-label input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.consent-text {
    font-size: 0.8125rem;
    color: var(--text-light);
    line-height: 1.5;
}

.consent-text a {
    color: var(--accent);
    text-decoration: underline;
}

.consent-error {
    border: 1px solid var(--error);
    padding: 0.75rem;
    border-radius: var(--radius);
    background: var(--error-bg);
}

/* ─── Submit button ──────────────────────── */

.btn-submit {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    margin-top: 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-submit:hover {
    background: var(--accent-hover);
}

.btn-submit:active {
    transform: scale(0.99);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-adicionar:hover {
    background: #047857;
}

/* ─── Obrigado page ──────────────────────── */

.obrigado-header {
    text-align: center;
    margin-bottom: 2rem;
}

.check-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    border: 2px solid var(--success);
}

.obrigado-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.obrigado-subtitulo {
    color: var(--text-light);
    font-size: 0.95rem;
}

.separator {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* ─── Selected needs list ────────────────── */

.selecionadas-section {
    background: var(--success-bg);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid #a7f3d0;
}

.selecionadas-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selecionada-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.check-icon {
    color: var(--success);
    font-weight: 700;
    font-size: 0.875rem;
}

.selecionada-icon {
    font-size: 1.125rem;
}

.selecionada-nome {
    font-weight: 500;
}

/* ─── Final message ──────────────────────── */

.fim-message {
    text-align: center;
    padding: 2rem;
    background: var(--bg-section);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
}

.fim-message p {
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 500;
}

/* ─── Alert ──────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #fecaca;
}

/* ─── Footer ─────────────────────────────── */

.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    text-align: center;
}

.footer-inner {
    max-width: 640px;
    margin: 0 auto;
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-lighter);
}

.footer a {
    color: var(--text-light);
    text-decoration: underline;
}

/* ─── Privacy page ───────────────────────── */

.privacy-page h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.privacy-page h2 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.privacy-page p,
.privacy-page li {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.privacy-page ul {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ─── Chat Widget ────────────────────────── */

#chat-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chat-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.chat-bubble:hover {
    transform: scale(1.1);
}

.chat-panel {
    display: none;
    flex-direction: column;
    width: 340px;
    height: 440px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    overflow: hidden;
}

@media (max-width: 400px) {
    .chat-panel {
        width: calc(100vw - 2rem);
        height: 60vh;
        right: 0;
    }
    #chat-widget { right: 1rem; }
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
}

.chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-msg {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg-bot {
    background: #f1f5f9;
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg-user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    margin: 0 2px;
    animation: chatDot 1.2s infinite;
}

.chat-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatDot {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

.chat-input {
    display: flex;
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    gap: 0.375rem;
}

.chat-input input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    outline: none;
    font-family: inherit;
}

.chat-input input:focus {
    border-color: var(--accent);
}

.chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
