/* ============================================================
   style.css — Estilos globais do Portal do Fatecano
   Carregado em TODAS as páginas (base.html + standalones)
   ============================================================ */

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafb;
    color: #191c1d;
    min-height: 100vh;
}

/* ---------- Design Tokens ---------- */
:root {
    /* Paleta principal */
    --color-primary:            #001e40;
    --color-primary-container:  #003366;
    --color-primary-fixed:      #d5e3ff;

    /* Superfícies */
    --color-surface:            #f8fafb;
    --color-surface-low:        #f2f4f5;
    --color-surface-high:       #e6e8e9;
    --color-surface-highest:    #e1e3e4;
    --color-surface-white:      #ffffff;

    /* Texto */
    --color-on-surface:         #191c1d;
    --color-on-surface-variant: #43474f;
    --color-secondary:          #525f75;

    /* Bordas */
    --color-outline:            #737780;
    --color-outline-variant:    #c3c6d1;

    /* Containers coloridos */
    --color-primary-fixed:      #d5e3ff;
    --color-tertiary-fixed:     #ffdbca;
    --color-secondary-container:#d6e3fe;
    --color-on-tertiary-fixed-variant:   #723610;
    --color-on-secondary-fixed-variant:  #3b475d;

    /* Feedback */
    --color-success:    #1b6e2e;  --color-success-bg:  #d4edda;
    --color-warning:    #7a4f00;  --color-warning-bg:  #fff3cd;
    --color-danger:     #7a1212;  --color-danger-bg:   #ffdad6;

    /* Border radius */
    --radius-lg:  1rem;
    --radius-xl:  1.5rem;
    --radius-2xl: 2rem;
}

/* ---------- Layout Shell ---------- */
.page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-body {
    display: flex;
    flex: 1;
}

/* ---------- Top Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 64px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.header-brand img {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

.header-brand span {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.header-nav {
    display: none; /* visível só em desktop via media query */
    gap: 0.25rem;
}

.header-nav a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-on-surface-variant);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.header-nav a:hover,
.header-nav a.active {
    background: var(--color-primary-fixed);
    color: var(--color-primary);
}

.header-nav a.active {
    font-weight: 700;
}

/* ---------- Bottom Nav (mobile) ---------- */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
    background: var(--color-surface-white);
    border-top: 1px solid var(--color-outline-variant);
    z-index: 50;
    box-shadow: 0 -4px 16px rgba(0, 30, 64, 0.06);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    text-decoration: none;
    color: var(--color-outline);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.75rem;
    border-radius: 0.75rem;
    transition: background 0.15s, color 0.15s;
}

.bottom-nav a.active {
    background: var(--color-primary-fixed);
    color: var(--color-primary);
}

.bottom-nav a .material-symbols-outlined {
    font-size: 1.35rem;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-block;
    background: var(--color-tertiary-fixed);
    color: var(--color-on-tertiary-fixed-variant);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
}

/* ---------- Botão primário ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary-container);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0, 51, 102, 0.2);
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    background: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 51, 102, 0.3);
}

.btn-primary:active  { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* ---------- Card genérico ---------- */
.card {
    background: var(--color-surface-white);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ---------- Animações ---------- */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ---------- Tipografia (hierarquia base) ---------- */
.label-xs {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-on-surface-variant);
}

/* ---------- Erro inline genérico ---------- */
.inline-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    display: none;
}

.inline-error.visible { display: block; }

/* ---------- BASE HTML (dicas / sobre) ---------- */
.base-main {
    flex: 1;
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem 1.5rem 6rem;
}
.base-main h1, .base-main h2, .base-main p { color: var(--color-primary); }

/* ---------- Responsive: md (768px+) ---------- */
@media (min-width: 768px) {
    .header-nav { display: flex; }
    .bottom-nav { display: none; }
}

/* ---------- Global Footer ---------- */
.page-footer {
    display: none; /* Oculto no mobile, dando espaço apenas para a bottom-nav */
    background: var(--color-surface-low);
    border-top: 1px solid var(--color-outline-variant);
    padding: 2.5rem 1.5rem;
    margin-top: auto;
}

.page-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.page-footer-brand {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--color-primary);
}

.page-footer-copy {
    font-size: 0.78rem;
    color: var(--color-outline);
    text-align: center;
    line-height: 1.55;
}

.page-footer-links {
    display: flex;
    gap: 1.5rem;
}

.page-footer-links a {
    font-size: 0.8rem;
    color: var(--color-outline);
    text-decoration: none;
    transition: color 0.15s;
}

.page-footer-links a:hover {
    color: var(--color-primary-container);
}

@media (min-width: 768px) {
    .page-footer {
        display: block;
    }
    .page-footer-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}
