/* ==========================================================================
   styles.css — Design system global do Tutor.AI
   --------------------------------------------------------------------------
   Layout compartilhado por TODAS as páginas:
     body (coluna) → .site-header (fluxo normal) → .site-main (flex: 1)
   Dentro de .site-main, cada página usa um wrapper de largura:
     .page            → largura padrão (--page-max)
     .page--narrow    → formulários (--page-narrow)
     .page--medium    → painéis/dashboards (--page-medium)
   O espaçamento lateral/vertical vem SEMPRE de .site-main (--gutter),
   nunca de padding-top fixo nas páginas.
   ========================================================================== */

:root {
    --bg-color: #273b56;
    --bg-color-deep: #1d2d43;
    --text-color: #ffffff;
    --btn-bg: #d4e1ed;
    --btn-text: #172a3a;
    --input-bg: #ffffff;
    --border-radius: 20px;
    --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --surface: rgba(255, 255, 255, 0.06);
    --surface-border: rgba(255, 255, 255, 0.12);

    --header-h: 64px;
    --gutter: clamp(12px, 4vw, 32px);
    --page-max: 1280px;
    --page-medium: 1000px;
    --page-narrow: 520px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: radial-gradient(ellipse at top, #2f4766 0%, var(--bg-color) 45%, var(--bg-color-deep) 100%) fixed;
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img { max-width: 100%; }

/* --------------------------------------------------------------------------
   Header / navegação
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    min-height: var(--header-h);
    padding: 10px var(--gutter);
    background: rgba(29, 45, 67, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-brand { display: inline-flex; align-items: center; height: 28px; }
.site-brand img { height: 100%; width: auto; }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nav-link {
    padding: 7px 16px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--btn-text);
    background: var(--btn-bg);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
}
.nav-link:hover { opacity: 0.85; transform: translateY(-1px); }
.nav-link.active { box-shadow: 0 0 0 2px var(--bg-color-deep), 0 0 0 4px var(--btn-bg); }
.nav-link--ghost {
    color: var(--text-color);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 560px) {
    .site-header { justify-content: center; }
    .site-nav { justify-content: center; width: 100%; }
    .nav-link { padding: 6px 12px; font-size: 0.82rem; }
}

/* --------------------------------------------------------------------------
   Área de conteúdo compartilhada
   -------------------------------------------------------------------------- */
.site-main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px var(--gutter) 48px;
}

.page          { width: 100%; max-width: var(--page-max); }
.page--medium  { max-width: var(--page-medium); }
.page--narrow  { max-width: var(--page-narrow); }
/* Centraliza verticalmente páginas curtas (login, cadastro, etc.) */
.page--center  { margin-block: auto; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 24px;
}
.page-header h1 { margin: 0; }
.page-header p  { margin: 6px 0 0; opacity: 0.6; font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   Tipografia (fluida)
   -------------------------------------------------------------------------- */
h1 { font-size: clamp(1.7rem, 4vw, 3rem); margin: 0 0 10px; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3.2vw, 2.5rem); margin: 0 0 20px; text-align: center; line-height: 1.2; }
p  { font-size: clamp(1rem, 1.6vw, 1.2rem); }

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */
.botao {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    padding: 10px 30px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.2s ease;
}
.botao:hover { opacity: 0.85; transform: translateY(-1px); }
.botoes { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 20px; }
.botoescentralizado { justify-content: center; }

/* --------------------------------------------------------------------------
   Superfícies e tabelas
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
}

/* Tabelas largas rolam horizontalmente em vez de cortar a página */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
}
.data-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, 0.06); vertical-align: top; }
.data-table .center { text-align: center; }
.data-table .muted  { opacity: 0.55; }
.data-table .empty  { padding: 40px; text-align: center; opacity: 0.55; }

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */
.flash {
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.08);
}
.flash-success { background: rgba(76, 209, 138, 0.15); border-color: rgba(76, 209, 138, 0.4); }
.flash-warning { background: rgba(240, 180, 60, 0.15); border-color: rgba(240, 180, 60, 0.4); }
.flash-danger  { background: rgba(232, 65, 24, 0.15);  border-color: rgba(232, 65, 24, 0.45); }
.flash-info    { background: rgba(79, 179, 255, 0.15); border-color: rgba(79, 179, 255, 0.4); }

/* --------------------------------------------------------------------------
   Formulários
   -------------------------------------------------------------------------- */
.containerformulario {
    width: 100%;
    max-width: var(--page-narrow);
    margin-block: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-group label { font-size: 1rem; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
}
textarea { resize: vertical; min-height: 120px; border-radius: 15px; }

.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    align-items: center;
}
.radio-item { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }

.form-row { display: flex; gap: 15px; }
.form-row > * { flex: 1; min-width: 0; }

@media (max-width: 480px) {
    .form-row { flex-direction: column; }
    .botao { padding: 10px 20px; }
}

/* --------------------------------------------------------------------------
   Logo
   -------------------------------------------------------------------------- */
.logo { width: 180px; max-width: 60%; margin-bottom: 20px; }
.logo img { width: 100%; display: block; }
.logocentralizada { margin: 0 auto 20px auto; }

/* --------------------------------------------------------------------------
   Landing page (index / em construção)
   -------------------------------------------------------------------------- */
body.page-landing .site-main { padding: 0; }

.container {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: calc(100vh - var(--header-h));
}
.conteudotextual {
    flex: 0 0 42%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(28px, 6vw, 80px) var(--gutter) clamp(28px, 5vw, 60px) clamp(20px, 7vw, 110px);
}
.imagemdefundo {
    flex: 1;
    position: relative;
    background-image: url('../images/background.png');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: contain;
}

@media (max-width: 900px) {
    .container { flex-direction: column; min-height: 0; }
    .conteudotextual { flex: none; padding: 40px var(--gutter); text-align: center; align-items: center; }
    .conteudotextual .botoes { justify-content: center; }
    .imagemdefundo { min-height: 320px; background-position: center; }
}

/* Footer */
.footerlogos { margin-top: auto; padding-top: 24px; }
.footerlogos img { height: 30px; max-width: 100%; object-fit: contain; }
.footertexto { font-size: 0.8rem; margin-top: 10px; opacity: 0.8; }
