/* Variáveis e Reset */
:root {
    /* Paleta Oficial Instituto Diverse (Cartão Pré-Natal 2025) */
    --primary: #4B6E7D;        /* Azul Petróleo / Ardósia Diverse */
    --primary-dark: #2E4A56;   /* Azul Profundo (Hover e Títulos) */
    --secondary: #2E4A56;      /* Azul Ardósia Escuro */
    --accent: #D98A8C;         /* Rosa Antigo / Coral Suave */
    --diverse-lilac: #9B8EA9;  /* Lilás Suave */
    --diverse-sage: #8EB6A8;   /* Verde Sálvia */
    --diverse-ochre: #E2B879;  /* Ocre / Dourado Suave */

    /* Neutros e Superfícies */
    --bg-page: #F8F9FA;
    --bg-soft: #F1F4F6;
    --bg-field: #ECEEEF;
    --white: #FFFFFF;
    --text-main: #2C3A42;
    --text-muted: #64748B;
    --border: #DCE2E6;
    --shadow-sm: 0 2px 8px rgba(46, 74, 86, 0.06);
    --shadow-md: 0 8px 24px rgba(46, 74, 86, 0.10);
    --radius: 12px;
}

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

html {
    scroll-behavior: smooth;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--white);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #1b333d;
}

.btn-outline {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background-color: rgba(42, 157, 143, 0.08);
}

.btn-light {
    background-color: var(--white);
    color: var(--secondary);
}

.btn-light:hover {
    background-color: #f1f5f9;
}

.btn-transparent {
    border-color: rgba(255, 255, 255, 0.7);
    color: var(--white);
}

.btn-transparent:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.45rem;
    color: var(--secondary);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--primary);
    color: var(--white);
    font-size: 1.2rem;
}

.logo strong {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Ações do Topo Direito & Dropdown Login */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown {
    position: relative;
}

.dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.dropdown.open .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 270px;
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    list-style: none;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-light);
}

.dropdown-item i {
    font-size: 1.35rem;
    color: var(--primary);
    width: 28px;
    text-align: center;
}

.dropdown-item strong {
    display: block;
    font-size: 0.95rem;
    color: var(--secondary);
}

.dropdown-item span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border);
    margin: 6px 0;
}

/* Faixa Institucional Arcos Diverse */
.diverse-ribbon {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #4B6E7D 0%, #8EB6A8 28%, #E2B879 52%, #D98A8C 76%, #9B8EA9 100%);
}

/* Carrossel de Banners */
.hero-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 480px;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--white);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide-content {
    max-width: 680px;
    margin-left: 0;
}

.badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.slide-content h1 {
    font-size: 2.6rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.slide-content p {
    font-size: 1.12rem;
    line-height: 1.6;
    opacity: 0.92;
    margin-bottom: 28px;
}

.slide-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.carousel-control:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.carousel-control.prev { left: 20px; }
.carousel-control.next { right: 20px; }

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.2s;
}

.indicator.active {
    width: 28px;
    border-radius: 6px;
    background-color: var(--white);
}

/* Seção de Funcionalidades */
.features-section {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 52px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 24px;
}

.feature-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: rgba(42, 157, 143, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Seção Perfis */
.profiles-section {
    padding: 80px 0;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.profile-box {
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.profile-box.paciente {
    background-color: #f0faf8;
    border-color: #cdece6;
}

.profile-box.medico {
    background-color: #f2f6f9;
    border-color: #d3e0ea;
}

.profile-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 10px;
}

.profile-box.medico .profile-tag {
    color: var(--secondary);
}

.profile-box h3 {
    font-size: 1.55rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.profile-box ul {
    list-style: none;
    margin-bottom: 28px;
}

.profile-box li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.profile-box li i {
    color: var(--primary);
}

/* Rodapé */
.footer {
    background-color: var(--secondary);
    color: var(--white);
    padding: 40px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand .logo-text {
    font-size: 1.3rem;
    color: var(--white);
}

.footer-brand p {
    font-size: 0.9rem;
    opacity: 0.75;
    margin-top: 6px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--white);
}

/* Responsividade */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-carousel {
        height: 440px;
    }

    .slide-content h1 {
        font-size: 1.9rem;
    }

    .carousel-control {
        display: none;
    }
}

/* ==========================================
   Página de Cadastro e Formulários
   ========================================== */
.bg-page {
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-section {
    flex: 1;
    padding: 56px 0 80px;
}

.auth-card {
    max-width: 620px;
    margin: 0 auto;
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.badge-soft {
    display: inline-block;
    background-color: rgba(42, 157, 143, 0.12);
    color: var(--primary-dark);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.auth-header h1 {
    font-size: 1.85rem;
    color: var(--secondary);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.form-group label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--secondary);
}

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

.optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 38px 12px 40px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.96rem;
    color: var(--text-main);
    background-color: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}

.input-wrapper input:disabled {
    background-color: #f1f5f9;
    cursor: wait;
}

.input-wrapper input.is-valid {
    border-color: var(--primary);
}

.input-wrapper input.is-invalid {
    border-color: var(--accent);
}

.input-status {
    position: absolute;
    right: 12px;
    font-size: 0.95rem;
}

.input-status.valid {
    color: var(--primary);
}

.input-status.invalid {
    color: var(--accent);
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-msg {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 500;
    min-height: 16px;
}

/* Autocomplete Cidade / Estado */
.autocomplete-list {
    position: absolute;
    top: calc(100% - 22px);
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    z-index: 900;
    display: none;
}

.autocomplete-list.visible {
    display: block;
}

.autocomplete-list li {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.94rem;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover,
.autocomplete-list li.active {
    background-color: #f0faf8;
    color: var(--primary-dark);
    font-weight: 600;
}

/* Checkbox Termos */
.checkbox-group {
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 400 !important;
    color: var(--text-main) !important;
    line-height: 1.45;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1.02rem;
}

/* Feedback de Envio */
.form-feedback {
    display: none;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.94rem;
    font-weight: 500;
}

.form-feedback.success {
    display: block;
    background-color: #e6f7f4;
    border: 1px solid #a3dfd4;
    color: #1a665d;
}

.form-feedback.error {
    display: block;
    background-color: #fdf0ed;
    border: 1px solid #f5c2b6;
    color: #a63d24;
}

.auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .auth-card {
        padding: 28px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   MENU DROPDOWN DO OBSTETRA (dashboard.php e gestante.php)
   ========================================================================= */
.doc-menu-dropdown {
    position: relative;
    display: inline-block;
}

.doc-menu-dropdown .doc-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--white, #ffffff);
    border: 1.5px solid var(--border, #cbd5e1);
    color: var(--secondary, #1e293b);
    padding: 9px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: all 0.15s ease;
}

.doc-menu-dropdown .doc-menu-trigger:hover,
.doc-menu-dropdown.open .doc-menu-trigger {
    border-color: var(--primary, #4b6e7d);
    background-color: #f8fafc;
    color: var(--primary-dark, #36525e);
}

.doc-menu-dropdown .doc-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 255px;
    background-color: var(--white, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.15);
    padding: 8px;
    display: none;
    z-index: 3000;
    text-align: left;
}

.doc-menu-dropdown.open .doc-menu-panel {
    display: block;
}

.doc-menu-dropdown .doc-menu-header {
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.doc-menu-dropdown .doc-menu-header strong {
    display: block;
    color: var(--secondary, #1e293b);
    font-size: 0.92rem;
    margin-top: 2px;
}

.doc-menu-dropdown .doc-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main, #334155);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.doc-menu-dropdown .doc-menu-item:hover {
    background-color: var(--bg-soft, #f1f5f9);
    color: var(--primary-dark, #36525e);
}

.doc-menu-dropdown .doc-menu-item.active {
    background-color: rgba(75, 110, 125, 0.12);
    color: var(--primary-dark, #36525e);
}

.doc-menu-dropdown .doc-menu-item.danger {
    color: #b91c1c;
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 6px;
    padding-top: 11px;
    border-radius: 0 0 8px 8px;
}

.doc-menu-dropdown .doc-menu-item.danger:hover {
    background-color: #fef2f2;
    color: #991b1b;
}

.doc-menu-dropdown .menu-count-badge {
    background-color: var(--bg-soft, #f1f5f9);
    border: 1px solid var(--border, #cbd5e1);
    color: var(--secondary, #1e293b);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.doc-menu-dropdown .doc-menu-item.active .menu-count-badge {
    background-color: var(--primary, #4b6e7d);
    border-color: var(--primary, #4b6e7d);
    color: #ffffff;
}

/* Destaque clínico marcado pelo obstetra (Menu Exames Laboratoriais + Cartão Pré-Natal) */
.exame-destaque-vermelho,
.exam-pill.destaque-vermelho {
    color: #dc2626 !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    font-weight: 700 !important;
}

/* Linha de cabeçalho de datas acima de CI (7 colunas de datas) */
.sorologias-header-row {
    display: grid;
    grid-template-columns: 150px repeat(7, minmax(74px, 1fr));
    gap: 6px;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1.5px dashed #cbd5e1;
}

.sorologias-header-date {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary, #1e293b);
    background: #e2e8f0;
    padding: 4px 6px;
    border-radius: 6px;
}

/* Linhas dos 5 exames sorológicos / CI com 7 colunas */
.sorologias-exam-row {
    display: grid;
    grid-template-columns: 150px repeat(7, minmax(74px, 1fr));
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}

.sorologias-exam-row .exam-pill {
    text-align: center;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .sorologias-scroll-wrapper {
        overflow-x: auto;
        padding-bottom: 6px;
    }
    .sorologias-header-row,
    .sorologias-exam-row {
        min-width: 720px;
    }
}