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

:root {
    --primary: #B23B8E;
    --primary-light: #D45BAA;
    --primary-dark: #8B2A6E;
    --secondary: #C77DFF;
    --rose-light: #FFE4EE;
    --white: #FFFFFF;
    --gray-100: #F5EEF8;
    --gray-200: #E5D9E8;
    --gray-600: #8B6B7C;
    --gray-800: #5A4A5C;
    --gray-900: #2D1B36;
    --danger: #E74C6F;
    --success: #4ECDC4;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(145deg, #2D1B36 0%, #4A2542 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ========== CONTAINERS ========== */
.auth-container,
.app-container {
    max-width: 500px;
    width: 100%;
    background: #FEF7FC;
    border-radius: 48px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
    overflow: hidden;
    padding: 32px 24px;
}

/* ========== TÍTULOS ========== */
h1, h2, h3 {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    color: #B23B8E;
}

.logo {
    text-align: center;
    margin-bottom: 24px;
}

.logo span {
    font-size: 48px;
}

.logo h1 {
    font-size: 32px;
    background: linear-gradient(135deg, #B23B8E, #C77DFF);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.logo p {
    font-size: 14px;
    color: var(--gray-600);
}

/* ========== FORMULÁRIOS ========== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #5A4A5C;
    font-size: 14px;
}

.form-control,
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 60px;
    border: 1px solid #FFCDDF;
    background: white;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

.input-group textarea {
    border-radius: 24px;
    resize: vertical;
}

.form-control:focus,
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: #B23B8E;
    box-shadow: 0 0 0 3px #FFE2F0;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #B23B8E, #C77DFF);
    border: none;
    padding: 14px;
    border-radius: 60px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(0.98);
}

.link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.link a {
    color: #B23B8E;
    text-decoration: none;
    font-weight: 600;
}

/* ========== APP HEADER ========== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 32px; }
.logo h1 { font-size: 24px; background: linear-gradient(135deg, #B23B8E, #C77DFF); background-clip: text; -webkit-background-clip: text; color: transparent; }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; font-weight: 500; color: var(--primary-dark); }
.logout-btn { background: #FFCDDF; padding: 6px 14px; border-radius: 40px; text-decoration: none; color: #B23B8E; font-size: 12px; font-weight: 600; transition: 0.2s; }
.logout-btn:hover { background: #FFB8D1; }
.status-bar { display: flex; justify-content: space-between; padding: 8px 0; font-size: 12px; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); margin-bottom: 12px; }

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    margin: 16px 0;
}
.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
    transition: 0.2s;
}
.nav-icon { font-size: 22px; }
.nav-label { font-size: 10px; color: var(--gray-600); }
.nav-item.active { background: var(--rose-light); }
.nav-item.active .nav-label { color: var(--primary); font-weight: 600; }

/* ========== PÁGINAS ========== */
.page { display: none; }
.page.active { display: block; }

/* ========== CHAT ========== */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.ai-status { display: flex; align-items: center; gap: 12px; }
.ai-avatar { position: relative; width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary-light), var(--secondary)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.online-dot { position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px; background: var(--success); border-radius: 50%; border: 2px solid white; }
.ai-info h3 { font-size: 16px; }
.ai-info p { font-size: 11px; color: var(--success); }
.clear-chat-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 6px; }

.chat-messages {
    height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding-right: 4px;
}
.message { display: flex; flex-direction: column; max-width: 85%; }
.message.usuario { align-self: flex-end; }
.message.ia { align-self: flex-start; }
.message-bubble { padding: 12px 16px; border-radius: 20px; font-size: 14px; line-height: 1.4; }
.message.usuario .message-bubble { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border-bottom-right-radius: 4px; }
.message.ia .message-bubble { background: white; border: 1px solid var(--gray-200); border-bottom-left-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
.message-time { font-size: 10px; color: var(--gray-600); margin-top: 4px; margin-left: 12px; }

/* Menu elegante do chat */
.message-text .welcome-message { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #B23B8E; }
.message-text .menu-divider { height: 2px; background: linear-gradient(90deg, #FFCDDF, #B23B8E, #FFCDDF); margin: 12px 0; border-radius: 10px; }
.message-text .menu-title { font-size: 14px; margin-bottom: 12px; color: #5A4A5C; }
.message-text .menu-options { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.message-text .menu-options li {
    background: white;
    border-radius: 60px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #FFCDDF;
    cursor: pointer;
    transition: all 0.2s;
}
.message-text .menu-options li:hover { background: #FFF0F6; border-color: #B23B8E; transform: scale(0.98); }
.message-text .menu-number {
    background: linear-gradient(135deg, #B23B8E, #C77DFF);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}
.message-text .emergency-option .menu-number { background: linear-gradient(135deg, #E74C6F, #FF8A9F); }

.chat-input-container {
    display: flex;
    gap: 8px;
    background: white;
    padding: 8px 12px;
    border-radius: 60px;
    border: 1px solid var(--gray-200);
    margin-top: 8px;
}
.chat-input { flex: 1; border: none; background: transparent; padding: 12px 0; outline: none; font-size: 14px; }
.send-btn, .search-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: 0.1s;
}
.send-btn:active, .search-btn:active { transform: scale(0.95); }
.search-btn { background: var(--gray-600); font-size: 16px; }

/* ========== CENTRAL ========== */
.page-header { text-align: center; margin-bottom: 32px; }
.page-header h2 { font-size: 24px; margin-bottom: 8px; }
.page-header p { font-size: 14px; color: var(--gray-600); }
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-item {
    background: white;
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: 0.2s;
}
.info-item:hover { background: var(--gray-100); transform: translateX(4px); }
.info-icon { font-size: 32px; }
.info-content h3 { font-size: 15px; margin-bottom: 4px; }
.info-content p { font-size: 12px; color: var(--gray-600); }
.arrow { font-size: 18px; color: var(--gray-400); }

/* ========== FAMÍLIA ========== */
.family-cards { display: flex; flex-direction: column; gap: 20px; }
.family-card {
    background: linear-gradient(135deg, var(--rose-light), #E8D5FF);
    padding: 28px 20px 20px 20px;
    border-radius: 20px;
    position: relative;
    transition: transform 0.2s;
    border: 1px solid rgba(178, 59, 142, 0.2);
}
.family-card:hover { transform: translateY(-3px); }
.card-number {
    position: absolute;
    top: -14px;
    left: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.family-card h3 { font-size: 18px; margin-bottom: 12px; color: var(--primary-dark); font-family: 'Jost', sans-serif; }
.family-card p { font-size: 14px; line-height: 1.4; margin-bottom: 10px; color: var(--gray-800); }
.family-card ul { margin-left: 20px; margin-top: 6px; font-size: 13px; color: var(--gray-800); }
.family-card li { margin-bottom: 6px; }

/* ========== DENÚNCIA ========== */
.report-form { background: white; padding: 20px; border-radius: 24px; margin-bottom: 20px; }
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 60px;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}
.submit-btn:hover { opacity: 0.9; transform: scale(0.98); }
.help-tips {
    background: #FFF0F6;
    padding: 16px;
    border-radius: 24px;
    margin: 20px 0;
}
.help-tips strong { display: block; margin-bottom: 8px; color: var(--primary-dark); }
.help-tips ul { margin-left: 20px; font-size: 13px; }
.help-tips li { margin-bottom: 6px; }
.emergency-note { margin-top: 16px; padding: 12px; background: var(--rose-light); border-radius: 16px; text-align: center; font-size: 12px; display: flex; gap: 8px; align-items: center; justify-content: center; }

/* ========== APOIO ========== */
.support-list { display: flex; flex-direction: column; gap: 12px; }
.support-card {
    background: white;
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--gray-200);
}
.support-icon { font-size: 32px; }
.support-details { flex: 1; }
.support-details h3 { font-size: 16px; margin-bottom: 4px; }
.support-number { font-weight: 700; color: var(--primary); font-size: 14px; }
.support-desc { font-size: 12px; color: var(--gray-600); }
.call-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.1s;
    text-decoration: none;
}
.call-btn:active { transform: scale(0.96); }

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    max-width: 340px;
    width: 90%;
    border-radius: 48px;
    padding: 24px;
    text-align: left;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.close-modal { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--gray-600); }
.modal-body p, .modal-body ul { margin-bottom: 12px; font-size: 14px; }
.modal-body ul { margin-left: 20px; }

/* ========== RESPONSIVO ========== */
@media (max-width: 768px) {
    body { padding: 0; }
    .auth-container, .app-container { border-radius: 0; min-height: 100vh; }
    .family-card { padding: 28px 16px 16px 16px; }
    .card-number { width: 32px; height: 32px; font-size: 14px; top: -12px; left: 16px; }
    .family-card h3 { font-size: 16px; }
    .call-btn { padding: 6px 14px; font-size: 12px; }
    .chat-messages { height: 55vh; }
}
/* Botões de navegação do chat */
.chat-nav-buttons {
    display: flex;
    gap: 12px;
    margin: 12px 0 8px 0;
    justify-content: center;
}

.nav-btn {
    background: linear-gradient(135deg, #B23B8E, #C77DFF);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.nav-btn:hover {
    transform: scale(0.96);
    opacity: 0.9;
}