/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #060f1a;
    --bg-card: rgba(7, 20, 38, 0.9);
    --bg-input: rgba(4, 12, 26, 0.96);
    --border: rgba(0, 210, 160, 0.16);
    --border-focus: rgba(0, 210, 160, 0.7);
    --primary: #00d4a4;
    --primary-dark: #00a882;
    --primary-dim: rgba(0, 212, 164, 0.12);
    --primary-glow: rgba(0, 212, 164, 0.32);
    --secondary-accent: #0ea5e9;
    --gradient-p: linear-gradient(135deg, #00875f 0%, #00d4a4 100%);
    --gradient-p-soft: linear-gradient(135deg, rgba(0,135,95,.14) 0%, rgba(0,212,164,.09) 100%);
    --gradient-b: linear-gradient(135deg, #0055cc 0%, #00b4d8 100%);
    --gradient-success: linear-gradient(135deg, #008a5e, #00d4a4);
    --success: #00d4a4;
    --danger: #ff4d6d;
    --warning: #ffb800;
    --text: #cceee4;
    --text-muted: #3d6b5a;
    --text-label: #5a9a80;
    --radius: 18px;
    --radius-sm: 13px;
    --shadow: 0 4px 44px rgba(0,0,0,.55), 0 0 0 1px rgba(0,210,160,.08), 0 1px 0 rgba(255,255,255,.03);
    --shadow-btn: 0 6px 32px rgba(0,180,140,.52);
    --font: 'Inter', system-ui, sans-serif;
    --max-w: 780px;
    --topbar-h: 68px;
    --transition: .22s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 55% at 50% -8%, rgba(0,140,100,.2) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(0,80,180,.1) 0%, transparent 65%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== BACKGROUND ORBS ===== */
.bg-animation { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-orb {
    position: absolute; border-radius: 50%;
    filter: blur(130px); opacity: .16;
    animation: orbFloat 22s ease-in-out infinite;
}
.bg-orb-1 { width: 620px; height: 620px; background: #006644; top: -18%; left: -12%; animation-delay: 0s; }
.bg-orb-2 { width: 460px; height: 460px; background: #004488; bottom: -16%; right: -10%; animation-delay: -8s; }
.bg-orb-3 { width: 380px; height: 380px; background: #00aa77; top: 42%; left: 52%; animation-delay: -15s; }
@keyframes orbFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(48px,-36px) scale(1.06); }
    66% { transform: translate(-34px,22px) scale(.96); }
}

/* ===== TOPBAR ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--topbar-h);
    background: rgba(4,10,22,.97); backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px;
    box-shadow: 0 2px 32px rgba(0,0,0,.5);
}
.topbar::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
    background: var(--gradient-p); box-shadow: 0 0 18px var(--primary-glow);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo-icon {
    width: 42px; height: 42px; border-radius: 13px;
    background: var(--gradient-p);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
    box-shadow: 0 4px 18px var(--primary-glow);
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
    background: var(--gradient-p);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em;
}
.logo-sub { font-size: .67rem; font-weight: 600; color: var(--text-muted); margin-top: 3px;
    text-transform: uppercase; letter-spacing: .09em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-suporte-link {
    display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600;
    color: rgba(0,212,164,.7); text-decoration: none; padding: 8px 16px;
    border: 1px solid rgba(0,212,164,.2); border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.topbar-suporte-link:hover { color: var(--primary); border-color: rgba(0,212,164,.45); background: rgba(0,212,164,.07); }
.topbar-admin-link {
    display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600;
    color: var(--text-muted); text-decoration: none; padding: 8px 16px;
    border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.topbar-admin-link:hover { color: var(--text); border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.04); }

/* ===== MAIN & SCREENS ===== */
.portal-main {
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h));
    padding: 48px 24px 64px;
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
}
.screen { display: none; width: 100%; max-width: var(--max-w); animation: fadeUp .38s ease; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

/* ===== TELAS SPLIT (apenas login e registro) ===== */
#screen-login,
#screen-registro { max-width: none; width: 100%; }

#screen-login.active,
#screen-registro.active {
    position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
    flex-direction: row; align-items: stretch; overflow: hidden; padding: 0;
}

.medico-login-split { display: flex; width: 100%; height: 100%; }

/* ===== CADASTRO E PERFIL: fluxo normal (igual ao portal do gestor) ===== */
#screen-cadastro,
#screen-perfil { max-width: 1100px; width: 100%; }

#screen-cadastro .medico-cad-img,
#screen-perfil .medico-cad-img { display: none; }

#screen-cadastro .medico-cad-split,
#screen-perfil .medico-cad-split { height: auto; width: 100%; display: block; }

#screen-cadastro .medico-cad-panel,
#screen-perfil .medico-cad-panel {
    overflow-y: visible; border-left: none;
    padding: 0; background: transparent; width: 100%;
}

#screen-cadastro .medico-cad-panel > *,
#screen-perfil .medico-cad-panel > * { max-width: 100%; }

/* ─── Painel de imagem: login (flex expansível) ─── */
.medico-img-panel {
    flex: 1; min-width: 0; position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end;
    background: url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?w=1600&q=85') center/cover no-repeat;
}
.medico-img-panel::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(2,14,12,.45) 0%, rgba(0,20,16,.93) 100%);
}

/* ─── Painel de imagem: cadastro/perfil/registro (largura fixa) ─── */
.medico-cad-img {
    width: 300px; min-width: 300px; flex-shrink: 0;
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end;
    background: url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?w=1200&q=80') center/cover no-repeat;
}
.medico-cad-img::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(2,14,12,.45) 0%, rgba(0,20,16,.93) 100%);
}

/* ─── Conteúdo interno compartilhado ─── */
.medico-img-content { position: relative; z-index: 1; padding: 48px 40px; }
.medico-img-brand {
    font-size: 2.8rem; font-weight: 800; letter-spacing: -.06em;
    color: #fff; margin-bottom: 12px; line-height: 1;
    text-shadow: 0 2px 32px rgba(0,0,0,.5);
}
.medico-img-tagline {
    font-size: .92rem; color: rgba(255,255,255,.55); line-height: 1.7;
    margin-bottom: 28px;
}
.medico-img-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px; border-radius: 50px;
    background: rgba(0,212,164,.12); border: 1px solid rgba(0,212,164,.28);
    color: var(--primary); font-size: .78rem; font-weight: 700; letter-spacing: .03em;
    backdrop-filter: blur(8px);
}

/* ─── Painel de formulário: login/registro ─── */
.medico-form-panel {
    width: 480px; flex-shrink: 0; min-width: 0; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 44px;
    background: var(--bg);
    border-left: 1px solid rgba(0,212,164,.08);
}

/* ─── Painel de conteúdo: cadastro/perfil ─── */
.medico-cad-panel {
    flex: 1; min-width: 0; overflow-y: auto;
    padding: 36px 44px;
    display: flex; flex-direction: column; align-items: center;
    background: var(--bg);
    border-left: 1px solid rgba(0,212,164,.08);
}
.medico-cad-panel > * { width: 100%; max-width: 720px; }

/* ─── Login / Registro: cabeçalho do formulário ─── */
.medico-login-header { text-align: center; margin-bottom: 28px; }
.medico-login-header h2 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.035em; margin-bottom: 8px; }
.medico-login-header p { font-size: .9rem; color: var(--text-muted); }
.medico-login-header .hero-icon.sm {
    width: 52px; height: 52px; border-radius: 16px; font-size: 1.2rem;
    margin: 0 auto 18px;
}

/* ─── Responsivo ─── */
@media (max-width: 860px) {
    #screen-login.active,
    #screen-registro.active {
        position: static; flex-direction: column;
        min-height: calc(100vh - var(--topbar-h));
    }
    .medico-img-panel { display: none; }
    .medico-form-panel { width: 100%; padding: 32px 20px; justify-content: flex-start; padding-top: 36px; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ENTRADA SCREEN ===== */
.entrada-hero {
    text-align: center; margin-bottom: 44px;
}
.hero-icon {
    width: 88px; height: 88px; border-radius: 28px; margin: 0 auto 24px;
    background: var(--gradient-p);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: #fff;
    box-shadow: 0 8px 40px var(--primary-glow), 0 0 0 1px rgba(0,212,164,.25);
}
.hero-icon.sm {
    width: 64px; height: 64px; border-radius: 20px; margin-bottom: 18px; font-size: 1.5rem;
    box-shadow: 0 6px 28px var(--primary-glow);
}
.entrada-hero h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; margin-bottom: 12px; }
.entrada-hero p { font-size: 1rem; color: var(--text-muted); max-width: 440px; margin: 0 auto; line-height: 1.6; }

.option-cards { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.option-card {
    display: flex; align-items: center; gap: 22px; padding: 26px 28px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    text-align: left; width: 100%;
    box-shadow: var(--shadow); transition: all var(--transition);
    position: relative; overflow: hidden;
}
.option-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--gradient-p); opacity: 0; transition: opacity var(--transition);
}
.option-card:hover { border-color: rgba(0,212,164,.35); transform: translateY(-2px);
    box-shadow: 0 8px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(0,212,164,.16); }
.option-card:hover::before { opacity: 1; }
.option-card.secondary::before { background: var(--gradient-b); }
.option-card.secondary:hover { border-color: rgba(14,165,233,.3); }

.option-icon {
    width: 58px; height: 58px; border-radius: 18px; flex-shrink: 0;
    background: var(--gradient-p);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}
.option-icon.secondary {
    background: var(--gradient-b);
    box-shadow: 0 4px 20px rgba(14,165,233,.35);
}
.option-body { flex: 1; }
.option-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.option-body p { font-size: .875rem; color: var(--text-muted); line-height: 1.5; }
.option-arrow { color: var(--text-muted); font-size: .9rem; flex-shrink: 0; transition: transform var(--transition); }
.option-card:hover .option-arrow { transform: translateX(4px); color: var(--primary); }

/* ===== SCREEN NAVIGATION ===== */
.screen-nav { width: 100%; margin-bottom: 20px; }
.btn-voltar {
    display: inline-flex; align-items: center; gap: 8px;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: .875rem; font-weight: 600; font-family: var(--font);
    padding: 8px 0; transition: all var(--transition);
}
.btn-voltar:hover { color: var(--primary); }

/* ===== SCREEN HERO (small) ===== */
.screen-hero { text-align: center; margin-bottom: 32px; }
.screen-hero.sm { }
.screen-hero h2 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.screen-hero p { color: var(--text-muted); font-size: .9rem; }

/* ===== SINGLE CARD (busca) ===== */
.single-card {
    width: 100%; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
    position: relative; overflow: hidden;
}
.single-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--gradient-p);
}
.hint-text {
    text-align: center; font-size: .82rem; color: var(--text-muted); margin-top: 20px;
}
.link-btn {
    background: none; border: none; color: var(--primary); cursor: pointer;
    font-size: inherit; font-family: var(--font); font-weight: 600;
    text-decoration: underline; text-underline-offset: 3px; transition: opacity var(--transition);
}
.link-btn:hover { opacity: .75; }
.mt-16 { margin-top: 16px; }
.ml-auto { margin-left: auto; }
.full-width { width: 100%; justify-content: center; }

/* ===== CADASTRO TOPBAR ===== */
.cadastro-topbar {
    display: flex; align-items: center; gap: 16px;
    width: 100%; margin-bottom: 24px;
}
.cadastro-topbar .btn-voltar {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    background: rgba(0,180,140,.08); border: 1px solid rgba(0,180,140,.2);
    display: flex; align-items: center; justify-content: center;
    padding: 0; transition: all var(--transition);
}
.cadastro-topbar .btn-voltar:hover { background: rgba(0,180,140,.18); border-color: var(--primary); color: var(--primary); }
.cadastro-topbar-info h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.025em; margin-bottom: 2px; }
.cadastro-topbar-info p { font-size: .8rem; color: var(--text-muted); }

/* ===== STEPS INDICATOR ===== */
.steps-indicator {
    display: flex; align-items: center;
    margin-bottom: 24px; padding: 22px 32px; width: 100%;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.steps-indicator::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.step {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    cursor: pointer; transition: all var(--transition); min-width: 80px;
}
.step-circle {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,180,140,.07); border: 2px solid rgba(0,180,140,.2);
    transition: all var(--transition); position: relative;
}
.step-num {
    font-weight: 800; font-size: .9rem; color: var(--text-muted);
    transition: all var(--transition); position: absolute;
}
.step-check {
    font-size: .82rem; color: var(--primary); transition: all var(--transition);
    position: absolute; opacity: 0; transform: scale(.4);
}
.step-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); transition: color var(--transition); text-align: center; }

.step.active .step-circle {
    background: var(--gradient-p); border-color: transparent;
    box-shadow: 0 0 28px var(--primary-glow), 0 0 0 6px rgba(0,212,164,.12);
}
.step.active .step-num { color: #04100e; font-size: .95rem; }
.step.active .step-label { color: var(--text); font-weight: 700; }

.step.completed .step-circle { background: rgba(0,212,164,.12); border-color: var(--primary); }
.step.completed .step-num { opacity: 0; transform: scale(.3); }
.step.completed .step-check { opacity: 1; transform: scale(1); }
.step.completed .step-label { color: var(--primary); }

.step-connector {
    flex: 1; height: 3px; margin: 0 8px; margin-bottom: 20px;
    background: rgba(0,180,140,.12); border-radius: 2px; overflow: hidden;
}
.step-connector-fill {
    height: 100%; width: 0%;
    background: var(--gradient-p); border-radius: 2px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* ===== FORM CARD ===== */
.form-step { display: none; width: 100%; animation: fadeUp .3s ease; }
.form-step.active { display: block; }
.form-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.form-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.form-card-header {
    padding: 22px 28px; border-bottom: 1px solid rgba(0,210,160,.09);
    display: flex; align-items: center; gap: 16px;
    background: linear-gradient(135deg, rgba(0,70,48,.1), rgba(0,100,65,.04));
}
.fch-icon {
    width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(0,135,95,.25), rgba(0,212,164,.15));
    border: 1px solid rgba(0,212,164,.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(0,212,164,.2), inset 0 1px 0 rgba(255,255,255,.06);
}
.fch-info { flex: 1; }
.fch-title { font-size: 1.05rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; margin-bottom: 3px; }
.fch-sub { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.fch-badge {
    padding: 6px 16px; border-radius: 50px; flex-shrink: 0;
    background: rgba(0,212,164,.09); color: var(--primary);
    border: 1px solid rgba(0,212,164,.22);
    font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}

/* ===== FORM SECTION ===== */
.form-section {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(0,210,160,.06);
}
.form-section:last-of-type { border-bottom: none; }
.form-section-label {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: var(--primary); opacity: .8;
    display: flex; align-items: center; gap: 6px; margin-bottom: 16px;
}
.form-section .form-grid { padding: 0; gap: 16px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px 28px; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    display: block; font-size: .75rem; font-weight: 700; color: var(--text-label);
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: .055em;
}
.required { color: var(--danger); }

.form-group input, .form-group select {
    width: 100%; padding: 13px 16px; border-radius: var(--radius-sm);
    background: var(--bg-input); border: 1px solid rgba(0,180,140,.18);
    color: var(--text); font-size: .92rem; font-family: var(--font);
    transition: all var(--transition); outline: none;
    box-shadow: inset 0 1px 4px rgba(0,0,0,.3);
}
.form-group input::placeholder { color: var(--text-muted); opacity: .55; }
.form-group input:hover, .form-group select:hover { border-color: rgba(0,210,160,.34); }
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,212,164,.12), inset 0 1px 4px rgba(0,0,0,.2);
    background: rgba(3,10,22,.98);
}
.form-group input.invalid, .form-group select.invalid {
    border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255,77,109,.1);
}
.error-msg { font-size: .77rem; color: var(--danger); margin-top: 5px; display: block; min-height: 18px; font-weight: 500; }

.form-group select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%233d6b5a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}

/* ===== CHECKBOX GRID ===== */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.checkbox-card {
    display: flex; align-items: center; gap: 10px; padding: 12px 15px;
    background: var(--bg-input); border: 1px solid rgba(0,180,140,.15);
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: .875rem; color: var(--text-muted); user-select: none;
    transition: all var(--transition);
}
.checkbox-card:hover { border-color: rgba(0,210,160,.38); background: rgba(0,100,70,.08); }
.checkbox-card input { display: none; }
.checkmark {
    width: 20px; height: 20px; border-radius: 6px; border: 2px solid rgba(0,200,150,.22);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: all var(--transition);
}
.checkmark::after { content: '✓'; font-size: .72rem; color: transparent; font-weight: 800; transition: color var(--transition); }
.checkbox-card input:checked ~ .checkmark {
    background: var(--gradient-p); border-color: transparent;
    box-shadow: 0 2px 14px var(--primary-glow);
}
.checkbox-card input:checked ~ .checkmark::after { color: #04100e; }
.checkbox-card input:checked ~ span:last-child { color: var(--text); font-weight: 500; }
.checkbox-card:has(input:checked) { border-color: rgba(0,212,164,.35); background: rgba(0,120,80,.1); }

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 28px; border-top: 1px solid rgba(0,210,160,.09);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
    border: none; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 600;
    font-family: var(--font); cursor: pointer; transition: all var(--transition); letter-spacing: -.01em;
}
.btn-primary { background: var(--gradient-p); color: #04100e; box-shadow: 0 2px 20px var(--primary-glow); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--shadow-btn); transform: translateY(-2px); }
.btn-secondary { background: rgba(0,180,140,.09); color: var(--primary); border: 1px solid rgba(0,212,164,.22); }
.btn-secondary:hover { background: rgba(0,180,140,.17); border-color: rgba(0,212,164,.4); }
.btn-success { background: var(--gradient-success); color: #04100e; font-weight: 700; box-shadow: 0 2px 22px var(--primary-glow); }
.btn-success:hover { filter: brightness(1.08); box-shadow: 0 8px 36px var(--primary-glow); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid rgba(0,200,140,.2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(0,212,164,.06); }
.btn-sm { padding: 8px 16px; font-size: .8rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ===== PERFIL SCREEN ===== */
.perfil-header-card {
    width: 100%; display: flex; align-items: center; gap: 22px;
    padding: 28px 32px; margin-bottom: 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.perfil-header-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient-p); box-shadow: 0 0 18px var(--primary-glow);
}
.perfil-avatar {
    width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
    background: var(--gradient-p);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; color: #04100e;
    box-shadow: 0 4px 24px var(--primary-glow), 0 0 0 3px rgba(0,212,164,.18);
}
.perfil-header-info { flex: 1; }
.perfil-header-info h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 4px; }
.perfil-header-info p { font-size: .88rem; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.tipo-badge {
    display: inline-block; padding: 3px 12px; border-radius: 50px;
    font-size: .72rem; font-weight: 700;
    background: rgba(0,212,164,.12); color: var(--primary);
    border: 1px solid rgba(0,212,164,.25); letter-spacing: .02em;
}
.tipo-badge.residente { background: rgba(255,184,0,.12); color: var(--warning); border-color: rgba(255,184,0,.25); }
.tipo-badge.generalista { background: rgba(14,165,233,.12); color: #38bdf8; border-color: rgba(14,165,233,.25); }

#perfil-cards { width: 100%; display: flex; flex-direction: column; gap: 16px; }

.pcard {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.pcard::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0,212,164,.45), transparent);
}
.pcard-header {
    padding: 18px 26px; font-size: .95rem; font-weight: 700;
    border-bottom: 1px solid rgba(0,210,160,.08);
    display: flex; align-items: center; gap: 10px; color: var(--text);
    background: rgba(0,80,55,.05);
}
.pcard-header i {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, rgba(0,135,95,.2), rgba(0,212,164,.12));
    border: 1px solid rgba(0,212,164,.25);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary); font-size: .82rem;
}
.pcard-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.prow {
    padding: 16px 26px; border-bottom: 1px solid rgba(0,200,150,.05);
    display: flex; flex-direction: column; gap: 5px;
}
.prow.full { grid-column: 1 / -1; }
.prow:last-child, .prow:nth-last-child(2):not(.full) { border-bottom: none; }
.plabel { font-size: .72rem; font-weight: 700; color: var(--text-label); text-transform: uppercase; letter-spacing: .06em; }
.pval { font-size: .9rem; font-weight: 500; color: var(--text); }

.pbadges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.pbadge {
    display: inline-block; padding: 4px 12px; border-radius: 50px;
    font-size: .75rem; font-weight: 600;
    background: rgba(0,212,164,.1); color: var(--primary);
    border: 1px solid rgba(0,212,164,.22);
}

.perfil-data {
    width: 100%; text-align: center; margin-top: 20px;
    font-size: .78rem; color: var(--text-muted);
}

/* ===== TERMOS DE USO — CHECKBOX ===== */
.termos-aceite-area {
    width: 100%; padding: 20px 26px;
    background: rgba(0,212,164,.04); border: 1px solid rgba(0,212,164,.18);
    border-radius: var(--radius); margin-bottom: 8px;
}
.termos-label {
    display: flex; align-items: flex-start; gap: 14px; cursor: pointer;
}
.termos-label input[type="checkbox"] { display: none; }
.termos-checkmark {
    width: 20px; height: 20px; min-width: 20px; border-radius: 6px;
    border: 2px solid rgba(0,212,164,.4); background: rgba(0,212,164,.06);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); margin-top: 1px;
}
.termos-label input:checked + .termos-checkmark {
    background: var(--primary); border-color: var(--primary);
}
.termos-label input:checked + .termos-checkmark::after {
    content: ''; width: 5px; height: 9px;
    border: 2px solid #04100e; border-top: none; border-left: none;
    transform: rotate(45deg); margin-top: -2px;
}
.termos-texto { font-size: .88rem; color: var(--text-muted); line-height: 1.6; }
.link-termos {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--primary); font-size: .88rem; font-weight: 600;
    text-decoration: underline; text-underline-offset: 3px;
}
.link-termos:hover { color: #fff; }
.termos-aceite-area .error-msg { display: block; margin-top: 10px; }

/* ===== MODAL TERMOS ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 900;
    background: rgba(2,8,20,.82); backdrop-filter: blur(8px);
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-termos {
    width: 100%; max-width: 700px; max-height: 90vh;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 24px 80px rgba(0,0,0,.6);
    display: flex; flex-direction: column; overflow: hidden;
    animation: fadeUp .28s ease;
}
.modal-termos-header {
    padding: 24px 28px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: rgba(0,212,164,.04); flex-shrink: 0;
}
.modal-termos-title { display: flex; align-items: center; gap: 14px; }
.modal-termos-title h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 2px; }
.modal-termos-title p { font-size: .78rem; color: var(--text-muted); }
.modal-termos-close {
    background: none; border: none; color: var(--text-muted); font-size: 1.6rem;
    cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px;
    transition: all var(--transition); flex-shrink: 0;
}
.modal-termos-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
.modal-termos-body {
    flex: 1; overflow-y: auto; padding: 28px;
    scrollbar-width: thin; scrollbar-color: rgba(0,212,164,.25) transparent;
}
.modal-termos-body::-webkit-scrollbar { width: 5px; }
.modal-termos-body::-webkit-scrollbar-track { background: transparent; }
.modal-termos-body::-webkit-scrollbar-thumb { background: rgba(0,212,164,.25); border-radius: 4px; }
.termos-section { margin-bottom: 24px; }
.termos-section h3 {
    font-size: .9rem; font-weight: 700; color: var(--primary);
    margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.termos-section h3 i { font-size: .82rem; }
.termos-section p, .termos-section ul {
    font-size: .85rem; color: var(--text-muted); line-height: 1.75;
}
.termos-section ul { padding-left: 20px; margin-top: 8px; }
.termos-section ul li { margin-bottom: 6px; }
.termos-section strong { color: var(--text); font-weight: 600; }
.termos-atualizacao {
    text-align: center; font-size: .75rem; color: rgba(255,255,255,.25);
    margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border);
}
.modal-termos-footer {
    padding: 18px 28px; border-top: 1px solid var(--border);
    display: flex; gap: 12px; justify-content: flex-end; flex-shrink: 0;
    background: rgba(0,212,164,.03);
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed; inset: 0; background: rgba(4,10,22,.75);
    backdrop-filter: blur(6px); z-index: 500;
    display: none; align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.spinner {
    width: 44px; height: 44px; border-radius: 50%;
    border: 3px solid rgba(0,212,164,.15);
    border-top-color: var(--primary);
    animation: spin .7s linear infinite;
    box-shadow: 0 0 24px var(--primary-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 12px; padding: 14px 20px;
    background: rgba(4,12,26,.98); backdrop-filter: blur(18px);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .875rem; animation: toastIn .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 36px rgba(0,0,0,.55); min-width: 250px;
    transition: opacity .3s, transform .3s;
}
.toast.success { border-left: 3px solid var(--primary); }
.toast.success i { color: var(--primary); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error i { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: translateX(0); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .topbar { padding: 0 18px; }
    .topbar-admin-link span { display: none; }
    .topbar-suporte-link span { display: none; }
    .portal-main { padding: 32px 16px 48px; }
    .entrada-hero h1 { font-size: 1.55rem; }
    .option-card { padding: 20px 18px; gap: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .steps-indicator { padding: 14px 16px; }
    .step-label { display: none; }
    .step-line { max-width: 36px; }
    .pcard-body { grid-template-columns: 1fr; }
    .prow.full { grid-column: 1; }
    .perfil-header-card { flex-wrap: wrap; gap: 16px; }
    .perfil-header-card .btn-sm { width: 100%; justify-content: center; }
    .form-card-header { padding: 16px 20px; }
    .form-grid { padding: 20px; }
    .form-actions { padding: 16px 20px; }
    .single-card { padding: 24px 20px; }
}
