/* Jardín de la Infancia Caterina Volpicelli — hoja de estilos
   Mobile-first. Sin fuentes externas (ahorra datos en celulares económicos). */

:root {
    --pink: #d6336c;
    --pink-dark: #a61e4d;
    --pink-light: #fbe6ef;
    --purple: #6f42c1;
    --purple-dark: #4d2d8a;
    --teal: #0ca9a0;
    --yellow: #f4a300;
    --bg: #fdf7fb;
    --card: #ffffff;
    --text: #2d2a3a;
    --text-light: #6b6478;
    --border: #f1dfea;
    --success-bg: #e6f7ee;
    --success-text: #1b7a43;
    --danger-bg: #fdeceb;
    --danger-text: #b3261e;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 10px rgba(111, 66, 193, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 16px;
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; color: var(--purple-dark); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── Header / navegación ─────────────────────────────────────── */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    max-width: 1080px;
    margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--pink-light); flex-shrink: 0; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; color: var(--purple-dark); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { display: block; font-size: 0.72rem; color: var(--text-light); }

.nav-toggle {
    display: inline-flex;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--purple-dark);
    cursor: pointer;
    padding: 4px 8px;
}

.nav-menu {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px 14px;
    border-top: 1px solid var(--border);
}
.nav-menu.open { display: flex; }
.nav-menu a {
    color: var(--text);
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.nav-menu a:hover, .nav-menu a.active { background: var(--pink-light); color: var(--pink-dark); text-decoration: none; }
.nav-menu .nav-sep { border-top: 1px solid var(--border); margin: 6px 0; }

@media (min-width: 860px) {
    .nav-toggle { display: none; }
    .nav-menu {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        border-top: none;
        padding: 0;
        gap: 4px;
    }
    .nav-menu a { padding: 8px 10px; font-size: 0.92rem; }
}

/* ── Botones ──────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-align: center;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-primary { background: var(--pink); color: #fff; }
.btn-secondary { background: var(--purple); color: #fff; }
.btn-outline { background: transparent; color: var(--purple); border: 1.5px solid var(--purple); }
.btn-danger { background: var(--danger-text); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }

/* ── Tarjetas ─────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .quick-links { grid-template-columns: repeat(4, 1fr); } }
.quick-link {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 10px;
    text-align: center;
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
}
.quick-link .icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.quick-link:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }

/* ── Insignias / badges ───────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-general { background: #ede7f6; color: var(--purple-dark); }
.badge-importante { background: var(--danger-bg); color: var(--danger-text); }
.badge-evento { background: #e3f4ff; color: #146fa8; }
.badge-recordatorio { background: #fff4d9; color: #8a6100; }
.badge-logrado { background: var(--success-bg); color: var(--success-text); }
.badge-proceso { background: #fff4d9; color: #8a6100; }
.badge-apoyo { background: var(--danger-bg); color: var(--danger-text); }
.badge-role { background: var(--pink-light); color: var(--pink-dark); }

.pin { color: var(--pink); font-weight: 700; }

/* ── Formularios ──────────────────────────────────────────────── */
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel],
input[type=number], input[type=file], select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    background: #fff;
    color: var(--text);
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }
.form-help { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

/* ── Alertas / mensajes flash ─────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.92rem; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--danger-bg); color: var(--danger-text); }

/* ── Tablas ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-light); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .02em; }

/* ── Hero público ─────────────────────────────────────────────── */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.hero img { width: 100%; height: 200px; object-fit: cover; }
@media (min-width: 640px) { .hero img { height: 300px; } }
.hero-welcome {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    margin-left: 12px;
    margin-right: 12px;
}
@media (min-width: 640px) {
    .hero-welcome { max-width: 380px; margin-left: 24px; }
}

.school-title { text-align: center; padding: 22px 16px 8px; }
.school-title img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 10px; border: 3px solid var(--pink-light); }
.school-title h1 { color: var(--pink); font-size: 1.4rem; margin-bottom: 2px; }
.school-title .subtitle { color: var(--purple); font-weight: 600; }
.school-title .tagline { color: var(--text-light); font-style: italic; margin-top: 6px; }

/* ── Pie de página ────────────────────────────────────────────── */
.site-footer {
    background: var(--purple-dark);
    color: #f1e9fb;
    margin-top: 32px;
    padding: 28px 0 18px;
}
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer a { color: #f1e9fb; }
.site-footer .quote { font-style: italic; opacity: .9; margin-top: 10px; }
.footer-bottom { text-align: center; font-size: 0.78rem; opacity: .7; margin-top: 18px; }

/* ── Galería ──────────────────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.photo-grid a { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }

/* ── Mensajes / chat ──────────────────────────────────────────── */
.chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; margin-bottom: 8px; font-size: 0.92rem; }
.chat-mine { background: var(--pink); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-theirs { background: #f0eaf7; color: var(--text); margin-right: auto; border-bottom-left-radius: 4px; }
.chat-meta { font-size: 0.7rem; opacity: 0.75; margin-top: 3px; }

/* ── Calendario ───────────────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--text-light); padding-bottom: 4px; }
.cal-day { background: #fff; border-radius: 8px; min-height: 58px; padding: 4px; font-size: 0.75rem; border: 1px solid var(--border); }
.cal-day .num { font-weight: 700; color: var(--text-light); }
.cal-day.has-event { background: var(--pink-light); }
.cal-day.today { border: 2px solid var(--pink); }
.cal-day .evt { display: block; background: var(--purple); color: #fff; border-radius: 5px; padding: 1px 4px; margin-top: 2px; font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-empty { background: transparent; border: none; }

/* ── Barra inferior en móvil (como en el mock) ────────────────── */
.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(111, 66, 193, 0.07);
    z-index: 60;
    /* Respeta la barra de gestos del iPhone */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 7px;
    color: var(--text);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    /* Área de toque cómoda con el pulgar */
    min-height: 52px;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a.active { color: var(--pink); }
.tabbar svg { width: 23px; height: 23px; display: block; }

/* Deja sitio para que la barra no tape el final del contenido */
body.has-tabbar .main-content { padding-bottom: 84px; }

@media (min-width: 860px) {
    .tabbar { display: none; }
    body.has-tabbar .main-content { padding-bottom: 40px; }
}

/* ── Utilidades ───────────────────────────────────────────────── */
.text-light { color: var(--text-light); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gap-8 { gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-light); }
.empty-state .icon { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.main-content { padding: 18px 0 40px; min-height: 60vh; }
.section-title { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
