/* ═══════════════════════════════════════════════════════════
   BASE.CSS — Sistema Clínico Marcela Gumiero (Pérolas)
   Variáveis globais, reset, tipografia
═══════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

/* ─── Variáveis de Design ─── */
:root {
    /* Paleta Dourada */
    --gold-primary:   #d4af37;
    --gold-dark:      #b58b00;
    --gold-darker:    #8c6b00;
    --gold-light:     #f0d97a;
    --gold-subtle:    rgba(212, 175, 55, 0.12);
    --gold-border:    rgba(212, 175, 55, 0.25);

    /* Neutros Quentes */
    --cream-bg:       #f5f2eb;
    --cream-card:     #fdfcf9;
    --cream-border:   #e8e2d5;

    /* Texto */
    --text-dark:      #2d2519;
    --text-body:      #4a3f35;
    --text-muted:     #8c7851;
    --text-light:     #b8a990;

    /* Sidebar (escura, premium) */
    --sidebar-bg:     #1c1914;
    --sidebar-hover:  #2a2520;
    --sidebar-active: #2f2820;
    --sidebar-border: rgba(212, 175, 55, 0.15);
    --sidebar-width:  260px;

    /* Header */
    --header-height:  68px;
    --header-bg:      rgba(253, 252, 249, 0.95);
    --header-border:  #e8e2d5;

    /* Status */
    --success:        #2d7a4f;
    --success-bg:     #edf7f2;
    --warning:        #b07d00;
    --warning-bg:     #fdf6e3;
    --danger:         #c0392b;
    --danger-bg:      #fdf0ef;
    --info:           #2471a3;
    --info-bg:        #eaf4fb;

    /* Espaçamento */
    --space-xs:       4px;
    --space-sm:       8px;
    --space-md:       16px;
    --space-lg:       24px;
    --space-xl:       32px;
    --space-2xl:      48px;

    /* Mobile */
    --bottom-nav-height: 64px;

    /* Bordas */
    --radius-sm:      6px;
    --radius-md:      12px;
    --radius-lg:      16px;
    --radius-xl:      24px;

    /* Sombras */
    --shadow-sm:      0 2px 8px rgba(45, 37, 25, 0.06);
    --shadow-md:      0 4px 20px rgba(45, 37, 25, 0.08);
    --shadow-lg:      0 8px 40px rgba(45, 37, 25, 0.12);
    --shadow-gold:    0 4px 20px rgba(181, 139, 0, 0.20);

    /* Transições */
    --transition-fast:  all 0.15s ease;
    --transition-base:  all 0.25s ease;
    --transition-slow:  all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Tipografia */
    --font-display: 'Montserrat', sans-serif;
    --font-body:    'Montserrat', sans-serif;
    --font-mono:    'Courier New', monospace;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--cream-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Tipografia ─── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-dark);
    line-height: 1.3;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover { color: var(--gold-primary); }

/* ─── Utilitários ─── */
.text-gold    { color: var(--gold-dark); }
.text-muted   { color: var(--text-muted); }
.text-dark    { color: var(--text-dark); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-bold      { font-weight: 700; }
.fw-semi      { font-weight: 600; }
.fst-italic   { font-style: italic; }
.font-display { font-family: var(--font-display); }

.d-flex    { display: flex; }
.d-block   { display: block; }
.d-none    { display: none !important; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm    { gap: var(--space-sm); }
.gap-md    { gap: var(--space-md); }
.gap-lg    { gap: var(--space-lg); }
.flex-1    { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }

/* ─── Badge / Pill ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.badge-gold    { background: var(--gold-subtle); color: var(--gold-dark); border: 1px solid var(--gold-border); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }

/* ─── Scrollbar personalizada ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ─── Animações base ─── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
}

.animate-in {
    animation: fadeIn 0.4s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
