/* ══════════════════════════════════════════════════
   Robin Web — Estilos
   Paleta: Navy #1B4F72, Teal #148F77, Cream #FDF6EC
   ══════════════════════════════════════════════════ */

:root {
    --robin-navy: #1B4F72;
    --robin-navy-light: #2471A3;
    --robin-teal: #148F77;
    --robin-teal-light: #1ABC9C;
    --robin-cream: #FDF6EC;
    --robin-warm: #F8F1E4;
    --robin-text: #2C3E50;
    --robin-text-light: #5D6D7E;
    --robin-border: #E8E0D4;
    --robin-white: #FFFFFF;
    --robin-shadow: rgba(27, 79, 114, 0.08);
    --robin-user-bg: #E8F4FD;
    --robin-robin-bg: #FFFFFF;
    --radius: 16px;
    --radius-sm: 10px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--robin-text);
    background: var(--robin-cream);
    -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════
   LANDING PAGE
   ══════════════════════════════════════════════════ */

.landing {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.landing-container {
    max-width: 640px;
    width: 100%;
}

.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.robin-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.hero h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 3.2rem;
    color: var(--robin-navy);
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--robin-teal);
    font-weight: 500;
}

.about {
    padding: 1.5rem 0;
}

.about p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--robin-text);
    margin-bottom: 1rem;
}

.how-it-works {
    padding: 1.5rem 0;
}

.how-it-works h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--robin-navy);
    margin-bottom: 1.5rem;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    background: var(--robin-white);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px var(--robin-shadow);
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--robin-navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.step-text strong {
    display: block;
    font-size: 1rem;
    color: var(--robin-navy);
    margin-bottom: 0.3rem;
}

.step-text span {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--robin-text-light);
}

/* CTA */
.cta-section {
    padding: 2rem 0;
}

.cta-box {
    background: var(--robin-white);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 16px var(--robin-shadow);
    border: 1px solid var(--robin-border);
}

.cta-box p {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--robin-navy);
    margin-bottom: 1.2rem;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 420px;
    margin: 0 auto;
}

.form-fields input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--robin-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-fields input:focus {
    border-color: var(--robin-teal);
}

.form-fields input.shake {
    animation: shake 0.4s ease-in-out;
}

.nome-input-wrapper {
    display: flex;
    gap: 0.6rem;
    max-width: 420px;
    margin: 0 auto;
}

.nome-input-wrapper input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 2px solid var(--robin-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.nome-input-wrapper input:focus {
    border-color: var(--robin-teal);
}

.nome-input-wrapper input.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.form-fields button,
.nome-input-wrapper button,
.cta-box button,
.fim-box button,
.btn-primary {
    padding: 0.85rem 1.5rem;
    background: var(--robin-navy);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.form-fields button:hover,
.nome-input-wrapper button:hover,
.cta-box button:hover,
.fim-box button:hover,
.btn-primary:hover {
    background: var(--robin-navy-light);
    transform: translateY(-1px);
}

.nome-input-wrapper button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.cta-nota {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--robin-text-light);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: var(--robin-text-light);
    font-size: 0.88rem;
}

.footer-small {
    font-size: 0.78rem;
    margin-top: 0.3rem;
    opacity: 0.7;
}


/* ══════════════════════════════════════════════════
   CHAT PAGE
   ══════════════════════════════════════════════════ */

.chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--robin-warm);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: var(--robin-navy);
    color: white;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.robin-icon-small {
    font-size: 1.4rem;
}

.header-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.2rem;
}

.msg-counter {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Chat area */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.msg {
    display: flex;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.msg-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.msg-robin {
    align-self: flex-start;
}

.bubble {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.98rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.msg-user .bubble {
    background: var(--robin-navy);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-robin .bubble {
    background: var(--robin-white);
    color: var(--robin-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px var(--robin-shadow);
}

/* Typing indicator */
.typing-indicator .bubble {
    padding: 1rem 1.3rem;
}

.dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.dots span {
    width: 8px;
    height: 8px;
    background: var(--robin-text-light);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
    opacity: 0.4;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
.input-area {
    flex-shrink: 0;
    padding: 0.8rem 1rem;
    background: var(--robin-cream);
    border-top: 1px solid var(--robin-border);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 740px;
    margin: 0 auto;
    background: var(--robin-white);
    border: 2px solid var(--robin-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.6rem 0.5rem 1rem;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--robin-teal);
}

.input-wrapper textarea {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    background: transparent;
    max-height: 150px;
}

.input-wrapper button {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: var(--robin-navy);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.input-wrapper button:hover {
    background: var(--robin-navy-light);
}

.input-wrapper button:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Botão de microfone */
#btn-mic {
    background: var(--robin-teal);
}

#btn-mic:hover {
    background: var(--robin-teal-light);
}

#btn-mic.recording {
    background: #e74c3c;
    animation: pulse-mic 1.2s ease-in-out infinite;
}

@keyframes pulse-mic {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

.input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--robin-text-light);
    margin-top: 0.4rem;
    opacity: 0.6;
}

/* Mensagem de sistema (reconexão) */
.system-bubble {
    background: var(--robin-warm) !important;
    color: var(--robin-text-light) !important;
    font-size: 0.85rem;
    text-align: center;
    border: 1px dashed var(--robin-border);
    font-style: italic;
}

.msg-system {
    display: flex;
    justify-content: center;
    padding: 0.5rem 1rem;
}

/* Fim overlay */
.fim-overlay {
    position: fixed;
    inset: 0;
    background: rgba(27, 79, 114, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

.fim-box {
    background: var(--robin-white);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    max-width: 420px;
    margin: 1rem;
}

.fim-box h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    color: var(--robin-navy);
    margin: 0.5rem 0;
}

.fim-box p {
    color: var(--robin-text-light);
    line-height: 1.6;
    margin: 1rem 0 1.5rem;
}


/* ══════════════════════════════════════════════════
   PAINEL PAGE
   ══════════════════════════════════════════════════ */

.painel-page {
    min-height: 100vh;
    padding: 0 1rem 2rem;
}

.painel-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.painel-logo {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--robin-navy);
    text-decoration: none;
}

.painel-header h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--robin-text-light);
}

.painel-content {
    max-width: 900px;
    margin: 0 auto;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--robin-white);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    text-align: center;
    box-shadow: 0 1px 3px var(--robin-shadow);
}

.metric-value {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2rem;
    color: var(--robin-navy);
}

.metric-label {
    font-size: 0.82rem;
    color: var(--robin-text-light);
    margin-top: 0.3rem;
}

.painel-section {
    margin-bottom: 2rem;
}

.painel-section h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--robin-navy);
    margin-bottom: 1rem;
}

.painel-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--robin-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--robin-shadow);
}

.painel-table th {
    background: var(--robin-navy);
    color: white;
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.painel-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--robin-border);
    font-size: 0.9rem;
}

.painel-table tr:last-child td {
    border-bottom: none;
}

.empty-state {
    color: var(--robin-text-light);
    font-style: italic;
    padding: 2rem;
    text-align: center;
}

.cidades-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cidade-badge {
    background: var(--robin-white);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.88rem;
    color: var(--robin-navy);
    box-shadow: 0 1px 2px var(--robin-shadow);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   INSTALL BANNER (PWA)
   ══════════════════════════════════════════════════ */

.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--robin-teal);
    color: white;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 0.88rem;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.install-banner button {
    padding: 0.4rem 1rem;
    background: white;
    color: var(--robin-teal);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

.install-banner .dismiss {
    background: transparent;
    color: white;
    font-size: 1.1rem;
    padding: 0.2rem 0.5rem;
}


/* ══════════════════════════════════════════════════
   FIM DA CONVERSA — RESUMO PERFIL
   ══════════════════════════════════════════════════ */

.fim-overlay {
    overflow-y: auto;
}

.fim-box {
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.resumo-perfil {
    text-align: left;
    margin: 1rem 0;
}

.resumo-retrato {
    font-style: italic;
    color: var(--robin-teal);
    font-size: 1rem;
    line-height: 1.6;
    padding: 1rem;
    background: var(--robin-warm);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--robin-teal);
    margin-bottom: 1rem;
}

.resumo-secao {
    margin-bottom: 0.8rem;
}

.resumo-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--robin-text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.resumo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    background: var(--robin-cream);
    color: var(--robin-navy);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--robin-border);
}

.resumo-destaque {
    font-size: 1rem;
    color: var(--robin-navy);
    font-weight: 500;
}

.fim-promessa {
    margin: 1.2rem 0;
    padding: 1rem;
    background: var(--robin-cream);
    border-radius: var(--radius-sm);
}

.fim-promessa p {
    font-size: 0.92rem;
    color: var(--robin-text);
    margin: 0;
}

.fim-acoes {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn-secondary {
    padding: 0.75rem 1.2rem;
    background: transparent;
    color: var(--robin-navy);
    border: 2px solid var(--robin-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--robin-navy);
    background: var(--robin-cream);
}


/* ══════════════════════════════════════════════════
   NOTIFICAÇÕES PAGE
   ══════════════════════════════════════════════════ */

.notificacoes-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--robin-warm);
}

.header-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.notif-content {
    flex: 1;
    padding: 1rem;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.notif-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.notif-empty h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    color: var(--robin-navy);
    font-size: 1.4rem;
    margin: 0.5rem 0;
}

.notif-empty p {
    color: var(--robin-text-light);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.notif-dica {
    font-size: 0.88rem;
    color: var(--robin-teal);
    font-weight: 500;
}

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

.notif-card {
    background: var(--robin-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--robin-shadow);
    animation: fadeIn 0.4s ease;
}

.notif-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: var(--robin-cream);
    border-bottom: 1px solid var(--robin-border);
}

.notif-icon {
    font-size: 1.2rem;
}

.notif-date {
    font-size: 0.8rem;
    color: var(--robin-text-light);
}

.notif-card-body {
    padding: 1rem;
}

.notif-narrativa {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--robin-text);
    white-space: pre-line;
}

/* Bottom nav */
.bottom-nav {
    display: flex;
    border-top: 1px solid var(--robin-border);
    background: var(--robin-white);
    position: sticky;
    bottom: 0;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0;
    text-decoration: none;
    color: var(--robin-text-light);
    font-size: 0.75rem;
    transition: color 0.2s;
    position: relative;
}

.nav-item.active {
    color: var(--robin-navy);
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 0.15rem;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    background: var(--robin-teal);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}


/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .hero h1 { font-size: 2.5rem; }
    .msg { max-width: 90%; }
    .form-fields button,
    .nome-input-wrapper {
        flex-direction: column;
    }
    .nome-input-wrapper button,
    .form-fields button {
        width: 100%;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .fim-box {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    .fim-acoes {
        flex-direction: column;
    }
    .install-banner {
        flex-wrap: wrap;
        font-size: 0.82rem;
    }
}
