:root {
    --bg-page: #06101c;
    --bg-shell: rgba(10, 20, 36, 0.94);
    --bg-surface: rgba(12, 24, 42, 0.9);
    --bg-elevated: #14263e;
    --line-soft: rgba(110, 140, 175, 0.15);
    --line-strong: rgba(110, 140, 175, 0.28);
    --accent: #2d72b8;
    --accent-strong: #5aa2e3;
    --accent-deep: #1a4e82;
    --text-primary: #dde6f0;
    --text-secondary: #9bb0c7;
    --text-muted: #6f86a5;
    --success: #4a9e74;
    --danger: #ffb2b2;
    --advisor-green: #18aa55;
    --advisor-green-deep: #0f7840;
    --advisor-green-soft: rgba(24, 170, 85, 0.12);
    --advisor-green-border: rgba(24, 170, 85, 0.28);
    --shadow-lg: 0 16px 44px rgba(2, 8, 18, 0.34);
    --shadow-md: 0 8px 24px rgba(2, 8, 18, 0.22);
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-full: 999px;
}

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

html {
    background:
        radial-gradient(circle at top left, rgba(45, 114, 184, 0.18), transparent 32%),
        radial-gradient(circle at top right, rgba(24, 170, 85, 0.12), transparent 24%),
        linear-gradient(180deg, #06101c 0%, #081320 56%, #0a1628 100%);
    min-height: 100%;
}

body {
    min-height: 100svh;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: transparent;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

.entry-screen,
.channel-screen {
    min-height: 100svh;
    padding: 24px 16px 32px;
}

.entry-shell,
.channel-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.entry-hero,
.channel-shell {
    animation: fade-up 0.32s ease-out;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: contain;
    display: block;
    margin-bottom: 16px;
}

.entry-hero {
    margin-bottom: 20px;
}

.entry-eyebrow,
.entry-card-eyebrow,
.feedback-title {
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 0.74rem;
    color: var(--accent-strong);
}

.entry-hero h1,
.channel-shell h2 {
    margin-top: 10px;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    max-width: 820px;
}

.entry-subtitle,
.channel-subtitle {
    margin-top: 14px;
    max-width: 720px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.entry-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.public-intro-card,
.public-success-card {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--r-lg);
    border: 1px solid rgba(90, 162, 227, 0.18);
    background: rgba(10, 20, 36, 0.78);
    box-shadow: var(--shadow-md);
}

.public-intro-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-intro-card strong,
.public-success-card strong {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
}

.public-intro-card p,
.public-success-card p {
    margin-top: 4px;
    color: var(--text-secondary);
}

.public-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.entry-card,
.channel-card,
.feedback-section,
.shell {
    border: 1px solid var(--line-soft);
    background: var(--bg-shell);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}

.entry-card {
    border-radius: var(--r-xl);
    padding: 22px;
}

.entry-card-header h2 {
    margin-top: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.entry-card-header p:last-child {
    margin-top: 8px;
    color: var(--text-secondary);
}

.prospect-form {
    margin-top: 18px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field span,
.consent-title,
.legal-section h3 {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
}

.field input,
.field select,
.feedback-score-item select,
.feedback-comment-input {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--line-soft);
    background: rgba(14, 28, 52, 0.82);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.field input:focus,
.field select:focus,
.feedback-score-item select:focus,
.feedback-comment-input:focus,
.input-shell:focus-within {
    border-color: rgba(90, 162, 227, 0.42);
}

.field input::placeholder,
.feedback-comment-input::placeholder,
#message-input::placeholder {
    color: var(--text-muted);
}

.privacy-highlight {
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--r-md);
    background: rgba(18, 34, 58, 0.76);
    border: 1px solid rgba(90, 162, 227, 0.18);
}

.privacy-badge {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    border: 1px solid rgba(90, 162, 227, 0.22);
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.privacy-list {
    margin-top: 12px;
    padding-left: 18px;
    color: var(--text-secondary);
}

.privacy-list li + li {
    margin-top: 8px;
}

.legal-section.compact {
    margin-top: 18px;
}

.consent-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--r-md);
    background: rgba(14, 28, 50, 0.68);
    border: 1px solid rgba(90, 162, 227, 0.12);
}

.consent-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.consent-item input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.consent-item.optional span,
.consent-note,
.entry-status,
.feedback-status-msg {
    color: var(--text-secondary);
}

.legal-details {
    margin-top: 18px;
    border-radius: var(--r-md);
    border: 1px solid var(--line-soft);
    background: rgba(12, 24, 42, 0.7);
}

.legal-details summary {
    padding: 14px 16px;
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 600;
}

.legal-details-body {
    padding: 0 16px 16px;
    color: var(--text-secondary);
}

.legal-details-body p + p {
    margin-top: 10px;
}

.consent-note,
.privacy-error,
.entry-status {
    margin-top: 14px;
    font-size: 0.84rem;
}

.privacy-error {
    color: var(--danger);
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--r-md);
    font-weight: 700;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.96;
}

.btn-primary {
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: #eef4fa;
}

.btn-secondary {
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    background: rgba(12, 24, 42, 0.72);
    color: var(--text-primary);
}

.full-width {
    width: 100%;
}

.channel-screen {
    display: flex;
    align-items: center;
}

.channel-shell {
    padding: 28px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line-soft);
    background: var(--bg-shell);
    box-shadow: var(--shadow-lg);
}

.channel-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.channel-options.single-option {
    grid-template-columns: 1fr;
}

.channel-fallback {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.channel-fallback-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(90, 162, 227, 0.24);
    background: rgba(14, 28, 52, 0.72);
    color: var(--accent-strong);
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.channel-fallback-link:hover {
    background: rgba(20, 40, 68, 0.82);
    border-color: rgba(90, 162, 227, 0.38);
    transform: translateY(-1px);
}

.channel-fallback-note {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.6;
    max-width: 560px;
}

.channel-fallback-status {
    min-height: 1.2em;
    color: var(--accent-strong);
    font-size: 0.82rem;
    line-height: 1.5;
}

.channel-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border-radius: var(--r-lg);
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.channel-card strong {
    font-family: 'Manrope', sans-serif;
    font-size: 1.2rem;
}

.channel-card span {
    color: var(--text-secondary);
}

.channel-card:hover {
    transform: translateY(-2px);
}

.channel-card-whatsapp {
    background: linear-gradient(180deg, rgba(13, 38, 24, 0.92), rgba(10, 28, 20, 0.92));
    border: 1px solid var(--advisor-green-border);
    color: #e9fff1;
}

.channel-card-whatsapp strong {
    color: #e9fff1;
}

.channel-card-whatsapp span {
    color: #b7e7c7;
}

.channel-card-bot {
    background: linear-gradient(180deg, rgba(16, 31, 57, 0.96), rgba(12, 24, 42, 0.96));
    border: 1px solid rgba(90, 162, 227, 0.2);
    color: var(--text-primary);
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

.shell {
    width: min(820px, calc(100% - 24px));
    margin: 16px auto 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: var(--r-xl);
    overflow: hidden;
    height: calc(100svh - 32px);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(9, 18, 34, 0.74);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, rgba(45, 114, 184, 0.24), rgba(45, 114, 184, 0.1));
    border: 1px solid rgba(90, 162, 227, 0.22);
    font-family: 'Manrope', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-strong);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
}

.brand-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.status-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: rgba(74, 158, 116, 0.08);
    border: 1px solid rgba(74, 158, 116, 0.18);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--r-full);
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(74, 158, 116, 0.14);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px 28px 12px;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 5px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(110, 140, 175, 0.18);
    border-radius: var(--r-full);
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 32px 20px;
    text-align: center;
}

.es-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, rgba(45, 114, 184, 0.2), rgba(45, 114, 184, 0.08));
    border: 1px solid rgba(90, 162, 227, 0.2);
    display: grid;
    place-items: center;
    color: var(--accent-strong);
}

.es-content {
    max-width: 460px;
}

.es-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.55rem;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.es-subtitle {
    color: var(--text-secondary);
    line-height: 1.65;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 560px;
}

.quick-action {
    padding: 9px 15px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-soft);
    background: rgba(14, 28, 52, 0.7);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.3;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.quick-action:hover {
    border-color: rgba(90, 162, 227, 0.3);
    color: var(--text-primary);
    background: rgba(20, 40, 68, 0.85);
}

.advisor-cta,
.advisor-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--r-sm);
    background: var(--advisor-green-soft);
    border: 1px solid var(--advisor-green-border);
    color: var(--advisor-green) !important;
    font-weight: 700;
}

.advisor-cta:hover,
.advisor-link:hover {
    background: rgba(24, 170, 85, 0.16);
}

.message-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: msg-in 0.18s ease-out;
}

.message-wrapper.user {
    flex-direction: row-reverse;
}

@keyframes msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    display: grid;
    place-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.bot-avatar {
    background: rgba(45, 114, 184, 0.16);
    border: 1px solid rgba(90, 162, 227, 0.18);
    color: var(--accent-strong);
}

.user-avatar {
    background: rgba(26, 78, 130, 0.34);
    border: 1px solid rgba(90, 162, 227, 0.14);
}

.message {
    max-width: min(640px, 80%);
    padding: 12px 16px;
    border-radius: var(--r-lg);
    line-height: 1.68;
    font-size: 0.95rem;
}

.bot-message {
    background: rgba(14, 28, 52, 0.8);
    border: 1px solid var(--line-soft);
    border-top-left-radius: var(--r-xs);
}

.user-message {
    background: linear-gradient(135deg, rgba(22, 58, 92, 0.9), rgba(26, 78, 130, 0.84));
    border: 1px solid rgba(90, 162, 227, 0.16);
    border-top-right-radius: var(--r-xs);
}

.message p {
    margin-bottom: 8px;
}

.message p:last-child {
    margin-bottom: 0;
}

.message a,
.legal-card a {
    color: var(--accent-strong);
}

.message a:hover,
.legal-card a:hover {
    text-decoration: underline;
}

.sources {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(110, 140, 175, 0.12);
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 4px 2px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
    background: var(--accent-strong);
    opacity: 0.35;
    animation: type-pulse 1.1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes type-pulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    50% {
        transform: translateY(-4px);
        opacity: 0.9;
    }
}

.chat-input-container {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--line-soft);
    background: rgba(9, 18, 34, 0.8);
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--line-soft);
    background: rgba(14, 28, 52, 0.8);
    transition: border-color 0.18s ease;
}

#message-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
}

#send-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    background: var(--accent);
    color: #eef4fc;
    display: grid;
    place-items: center;
    transition: background 0.15s ease, transform 0.12s ease;
}

#send-btn:hover:not(:disabled) {
    background: var(--accent-strong);
    transform: scale(1.04);
}

#send-btn:disabled,
.btn-feedback-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.disclaimer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.feedback-section {
    width: min(820px, calc(100% - 24px));
    margin: 12px auto 20px;
    padding: 16px 20px;
    border-radius: var(--r-lg);
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-scores {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.feedback-score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.feedback-comment-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-feedback-send {
    padding: 10px 16px;
    border-radius: var(--r-sm);
    background: rgba(45, 114, 184, 0.14);
    border: 1px solid rgba(90, 162, 227, 0.22);
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

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

    .public-intro-card {
        grid-template-columns: 1fr;
    }

    .channel-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .shell,
    .feedback-section {
        width: calc(100% - 16px);
        margin-left: 8px;
        margin-right: 8px;
    }

    .shell {
        margin-top: 8px;
        height: calc(100svh - 16px);
        border-radius: var(--r-lg);
    }

    .chat-container {
        padding: 20px 18px 10px;
    }
}

@media (max-width: 640px) {
    .entry-screen,
    .channel-screen {
        padding: 14px 10px 20px;
    }

    .entry-card,
    .channel-shell {
        padding: 18px 16px;
        border-radius: var(--r-lg);
    }

    .entry-hero h1,
    .channel-shell h2 {
        font-size: 2rem;
    }

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

    .shell {
        width: 100%;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        height: 100svh;
    }

    .feedback-section {
        width: 100%;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .brand-subtitle {
        display: none;
    }

    .chat-container {
        padding: 16px 14px 8px;
        gap: 14px;
    }

    .message {
        max-width: 90%;
        font-size: 0.9rem;
    }

    .quick-action {
        font-size: 0.82rem;
        padding: 8px 12px;
    }

    .chat-input-container {
        padding: 10px 12px 14px;
    }

    .disclaimer,
    .feedback-comment-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-feedback-send {
        width: 100%;
        text-align: center;
    }
}
