@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
}

:root {
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #eef2ff;
    --ink: #1f2937;
    --ink-soft: #6b7280;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 6px rgba(16, 24, 40, 0.05), 0 10px 15px rgba(16, 24, 40, 0.08);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes growBarV {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes growBarH {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", Arial, sans-serif;
    background-color: #f7f7fb;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.app {
    display: flex;
    min-height: 100vh;
}


/* =========================
   BARRA LATERAL
   ========================= */

.sidebar {
    width: 240px;
    background-color: white;
    border-right: 1px solid var(--border);
    padding: 24px 16px;

    display: flex;
    flex-direction: column;

    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin-bottom: 32px;
    padding-left: 4px;
}

.logo strong,
.public-header .logo strong {
    color: var(--accent);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu a {
    text-decoration: none;
    color: var(--ink-soft);
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.menu a:hover {
    background-color: #f3f4f6;
    color: var(--ink);
}

.menu a.active {
    background-color: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    border-left-color: var(--accent);
}

.sidebar-account {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-account-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);

    padding: 0 12px;
    margin-bottom: 6px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account a {
    text-decoration: none;
    color: var(--ink-soft);
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-account a:hover {
    background-color: #f3f4f6;
    color: var(--ink);
}

.sidebar-logout-button {
    width: 100%;
    text-align: left;

    background: none;
    border: none;

    color: var(--ink-soft);
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;

    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-logout-button:hover {
    background-color: #fef2f2;
    color: #b91c1c;
}


/* =========================
   CONTENIDO
   ========================= */

.content {
    flex: 1;
    padding: 40px;
    animation: fadeInUp 0.35s ease both;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content h1 {
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.content p {
    color: var(--ink-soft);
}


/* =========================
   BOTONES
   ========================= */

.primary-button {
    display: inline-block;
    text-decoration: none;

    border: none;
    background-color: var(--accent);
    color: white;

    padding: 12px 18px;
    border-radius: 10px;

    font-size: 15px;
    font-weight: 600;
    cursor: pointer;

    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.primary-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.primary-button:active {
    transform: translateY(0);
}

.secondary-button {
    display: inline-block;
    text-decoration: none;

    background-color: white;
    color: var(--ink);

    border: 1px solid #d1d5db;

    padding: 12px 18px;
    border-radius: 10px;

    font-size: 15px;
    font-weight: 500;

    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.secondary-button:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.secondary-button:active {
    transform: translateY(0);
}


/* =========================
   ALUMNOS
   ========================= */

.student-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.section-title {
    font-size: 16px;
    margin: 0 0 12px;
}

.student-card,
.student-card:visited,
.student-card:hover,
.student-card:active {
    text-decoration: none;
    color: #1f2937;
}

.student-card {
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 24px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.student-card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.student-card h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.student-card p {
    margin: 0;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.active-status {
    background-color: #dcfce7;
    color: #166534;
}

.pending-status {
    background-color: #fef3c7;
    color: #92400e;
}

a.status {
    text-decoration: none;
    transition: transform 0.15s ease;
}

a.status:hover {
    transform: translateY(-1px);
}

.debt-details {
    margin-bottom: 12px;
}

.debt-details summary {
    cursor: pointer;
}

.debt-details summary::marker {
    color: #9ca3af;
}

.debt-details[open] > summary.student-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.debt-details-body {
    background-color: white;

    border: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;

    padding: 16px 20px 20px;
}

.debt-details-body .material-list {
    gap: 8px;
}

.debt-details-body .material-card {
    padding: 10px 14px;
}

.debt-details-body .material-actions {
    font-size: 14px;
    font-weight: 600;
    color: #52514e;
}


/* =========================
   FORMULARIOS
   ========================= */

.form {
    max-width: 700px;
}

.form-section {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;

    padding: 24px;
    margin-bottom: 20px;

    box-shadow: var(--shadow-sm);
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 18px;
}

.form-section label {
    display: block;
    margin-bottom: 6px;

    font-size: 14px;
    font-weight: 600;
}

.form-section input {
    width: 100%;

    padding: 11px 12px;
    margin-bottom: 18px;

    border: 1px solid #d1d5db;
    border-radius: 9px;

    font-size: 15px;
    font-family: inherit;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-section input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-section select {
    width: 100%;

    padding: 11px 12px;
    margin-bottom: 18px;

    border: 1px solid #d1d5db;
    border-radius: 9px;

    font-size: 15px;
    font-family: inherit;

    background-color: white;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-section select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-section textarea {
    width: 100%;
    min-height: 100px;

    padding: 11px 12px;
    margin-bottom: 18px;

    border: 1px solid #d1d5db;
    border-radius: 9px;

    font-size: 15px;
    font-family: inherit;

    resize: vertical;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-section textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-error {
    max-width: 700px;

    margin-bottom: 20px;
    padding: 12px 16px;

    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;

    color: #991b1b;
    font-size: 14px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 4px 0 10px;
}

.editor-toolbar-estado {
    font-size: 13px;
    color: var(--ink-soft);
}


/* =========================
   TARJETAS GENERALES
   ========================= */

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 20px;
    margin-top: 30px;
}

.card {
    background-color: white;

    padding: 24px;

    border-radius: 14px;
    border: 1px solid #e5e7eb;

    min-width: 0;

    box-shadow: var(--shadow-sm);
}

.card h2 {
    margin-top: 0;
    font-size: 18px;
}

.card p {
    color: #6b7280;
    line-height: 1.5;
}


/* =========================
   MATERIAL
   ========================= */

.material-toolbar {
    margin-bottom: 20px;
}

.material-search {
    width: 100%;
    max-width: 500px;

    padding: 12px 14px;

    border: 1px solid #d1d5db;
    border-radius: 9px;

    font-size: 15px;
    font-family: inherit;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.material-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.material-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* =========================
   ARCHIVOS Y CARPETAS
   ========================= */

.material-card,
.material-card:visited,
.material-card:hover,
.material-card:active {
    text-decoration: none;
    color: #1f2937;
}

.material-card {
    background-color: white;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    padding: 18px 20px;

    display: flex;
    align-items: center;

    gap: 16px;

    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.material-card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* Icono */

.material-icon {
    font-size: 28px;
}


/* Información */

.material-info {
    flex: 1;
    min-width: 0;
}

.material-info h2 {
    margin: 0 0 6px;

    font-size: 16px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-info p {
    margin: 0;
}


/* Acciones */

.material-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.material-actions .secondary-button {
    padding: 8px 12px;
    font-size: 14px;
}


/* =========================
   CARPETAS
   ========================= */

/*
   Las carpetas son enlaces completos,
   pero visualmente se comportan como
   cualquier otra tarjeta.
*/

.material-folder:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.material-folder-link,
.material-folder-link:visited,
.material-folder-link:hover,
.material-folder-link:active {
    display: flex;
    align-items: center;
    gap: 16px;

    flex: 1;
    min-width: 0;

    text-decoration: none;
    color: #1f2937;
}

.material-folder-link h2 {
    margin: 0;
    color: #1f2937;
    text-decoration: none;
}


/* =========================
   BREADCRUMB
   ========================= */

.material-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 20px;

    font-size: 15px;
}

.material-breadcrumb a {
    color: #1f2937;
    text-decoration: none;
}

.material-breadcrumb a:hover {
    text-decoration: underline;
}

.material-breadcrumb span {
    color: #9ca3af;
}


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 800px) {

    .sidebar {
        width: 190px;
    }

    .content {
        padding: 24px;
    }

    .page-header {
        align-items: flex-start;
        gap: 20px;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}

.danger-button {
    border: 1px solid #fecaca;
    background-color: white;
    color: #b91c1c;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.danger-button:hover {
    background-color: #fef2f2;
    transform: translateY(-1px);
}

.danger-zone {
    border-color: #fecaca;
}

.danger-zone h2 {
    color: #b91c1c;
}


/* =========================
   CALENDARIO
   ========================= */

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);

    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;

    overflow: hidden;
}

.calendar-header {
    padding: 12px 8px;

    text-align: center;
    font-size: 13px;
    font-weight: 600;

    border-bottom: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
}

.calendar-header:first-child {
    border-left: none;
}

.calendar-header-hoy {
    background-color: #eff6ff;
    color: #1e40af;
}

.calendar-hours {
    position: relative;
    min-height: 840px;
}

.calendar-hour-label {
    position: absolute;
    left: 0;
    right: 0;

    transform: translateY(-50%);

    font-size: 11px;
    color: #9ca3af;
    text-align: right;
    padding-right: 6px;
}

.calendar-day-column {
    position: relative;
    min-height: 840px;

    border-left: 1px solid #e5e7eb;
}

.calendar-event,
.calendar-event:visited,
.calendar-event:hover,
.calendar-event:active {
    text-decoration: none;
}

.calendar-event {
    position: absolute;

    border-radius: 6px;
    border: 1px solid transparent;
    padding: 4px 6px;

    font-size: 12px;
    line-height: 1.3;

    overflow: hidden;

    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-event:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.calendar-event-presencial,
.calendar-event-presencial:visited,
.calendar-event-presencial:hover,
.calendar-event-presencial:active {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

.calendar-event-online,
.calendar-event-online:visited,
.calendar-event-online:hover,
.calendar-event-online:active {
    background-color: #ede9fe;
    border-color: #ddd6fe;
    color: #5b21b6;
}

@media (max-width: 800px) {

    .calendar-grid {
        display: block;
    }

    .calendar-hours-header,
    .calendar-hours {
        display: none;
    }

    .calendar-header {
        border-left: none;
        text-align: left;
    }

    .calendar-day-column {
        min-height: 0;
        position: static;
        border-left: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 10px;
    }

    .calendar-event {
        position: static;
        display: block;
        margin-bottom: 8px;
        height: auto !important;
        width: auto !important;
    }

    .stat-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-bars {
        gap: 8px;
    }

    .chart-bar-label {
        font-size: 10px;
    }
}


/* =========================
   DASHBOARD / GRÁFICAS
   ========================= */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;

    padding: 24px;
    margin-bottom: 24px;

    box-shadow: var(--shadow-sm);
}

.chart-card h2 {
    margin-top: 0;
    font-size: 16px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;

    height: 180px;
    gap: 16px;

    margin-top: 20px;
}

.chart-bar-col {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    height: 100%;
    gap: 6px;

    min-width: 0;
}

.chart-bar-value {
    font-size: 12px;
    font-weight: 600;
    color: #52514e;

    white-space: nowrap;
}

.chart-bar {
    width: 100%;
    max-width: 48px;

    background-color: #86b6ef;
    border-radius: 4px 4px 0 0;

    min-height: 2px;

    transform-origin: bottom;
    animation: growBarV 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;

    transition: filter 0.15s ease;
}

.chart-bar:hover {
    filter: brightness(0.92);
}

.chart-bar-col:nth-child(1) .chart-bar { animation-delay: 0s; }
.chart-bar-col:nth-child(2) .chart-bar { animation-delay: 0.04s; }
.chart-bar-col:nth-child(3) .chart-bar { animation-delay: 0.08s; }
.chart-bar-col:nth-child(4) .chart-bar { animation-delay: 0.12s; }
.chart-bar-col:nth-child(5) .chart-bar { animation-delay: 0.16s; }
.chart-bar-col:nth-child(6) .chart-bar { animation-delay: 0.2s; }

.chart-bar-actual {
    background-color: #2a78d6;
}

.chart-bar-orange {
    background-color: #f5b491;
}

.chart-bar-orange.chart-bar-actual {
    background-color: #eb6834;
}

.chart-bar-aqua {
    background-color: #8fd8bf;
}

.chart-bar-aqua.chart-bar-actual {
    background-color: #1baf7a;
}

.chart-bar-label {
    font-size: 12px;
    color: #898781;
    text-align: center;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.chart-hbar-row {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 12px;
}

.chart-hbar-label {
    width: 160px;
    flex-shrink: 0;

    font-size: 14px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-hbar-track {
    flex: 1;

    background-color: #f3f4f6;
    border-radius: 6px;

    height: 28px;
}

.chart-hbar-fill {
    height: 100%;
    min-width: 40px;

    border-radius: 6px;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    padding-right: 10px;

    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.15s ease;
}

.chart-hbar-row:hover .chart-hbar-fill {
    filter: brightness(0.94);
}

.chart-hbar-value {
    font-size: 12px;
    font-weight: 600;
    color: white;

    white-space: nowrap;
}


/* =========================
   PÚBLICO
   ========================= */

.public-page {
    min-height: 100vh;
    background-color: #f7f7fb;
}

.public-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.public-container-article {
    max-width: 720px;
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    background-color: white;
    border-bottom: 1px solid var(--border);

    padding: 18px 40px;
}

.public-header .logo {
    margin-bottom: 0;
    color: var(--ink);
    text-decoration: none;
}


/* HERO */

@keyframes heroGlowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-4%, 3%) scale(1.08); }
}

.public-hero {
    position: relative;
    overflow: hidden;

    background: linear-gradient(135deg, #4f46e5 0%, #7c6cf6 55%, #9d8cf9 100%);

    padding: 90px 20px 110px;
    text-align: center;
}

.public-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
    animation: heroGlowFloat 12s ease-in-out infinite;
}

.public-hero-glow-1 {
    width: 380px;
    height: 380px;
    top: -160px;
    left: -80px;
    background: #a5b4fc;
}

.public-hero-glow-2 {
    width: 320px;
    height: 320px;
    bottom: -160px;
    right: -60px;
    background: #f0abfc;
    animation-delay: -6s;
}

.public-hero-content {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.public-hero-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;

    padding: 6px 16px;
    border-radius: 20px;

    font-size: 13px;
    font-weight: 600;

    opacity: 0;
    animation: fadeInUp 0.6s ease both;
}

.public-hero h1 {
    color: white;
    font-size: 42px;
    line-height: 1.2;
    margin: 22px 0 16px;

    opacity: 0;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.public-hero-highlight {
    position: relative;
    color: #fde68a;
}

.public-hero p {
    color: rgba(255, 255, 255, 0.88);
    font-size: 17px;
    line-height: 1.6;
    margin: 0 auto;

    opacity: 0;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.public-hero-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 32px;
    flex-wrap: wrap;

    opacity: 0;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.public-hero-button-primary,
.public-hero-button-secondary {
    display: inline-block;
    text-decoration: none;

    padding: 13px 22px;
    border-radius: 10px;

    font-size: 15px;
    font-weight: 700;

    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.public-hero-button-primary {
    background-color: white;
    color: var(--accent);
    box-shadow: var(--shadow-md);
}

.public-hero-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.18);
}

.public-hero-button-secondary {
    background-color: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.public-hero-button-secondary:hover {
    background-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}


/* TARJETAS DE ENTRADA */

.public-feature-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;

    max-width: 900px;
    margin: -56px auto 0;
    position: relative;
    z-index: 1;
}

.public-feature-card,
.public-feature-card:visited,
.public-feature-card:hover,
.public-feature-card:active {
    text-decoration: none;
    color: var(--ink);
}

.public-feature-card {
    display: block;
    background-color: white;
    border-radius: 16px;
    padding: 32px;

    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    opacity: 0;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.public-feature-card:nth-child(2) {
    animation-delay: 0.5s;
}

.public-feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 30px rgba(16, 24, 40, 0.12);
}

.public-feature-icon {
    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
    border-radius: 14px;
    background-color: var(--accent-light);

    margin-bottom: 18px;
    transition: transform 0.2s ease;
}

.public-feature-card:hover .public-feature-icon {
    transform: scale(1.08) rotate(-4deg);
}

.public-feature-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.public-feature-card p {
    color: var(--ink-soft);
    line-height: 1.55;
    margin: 0 0 18px;
}

.public-feature-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;

    display: inline-block;
    transition: transform 0.15s ease;
}

.public-feature-card:hover .public-feature-link {
    transform: translateX(4px);
}

/* REVELADO AL HACER SCROLL */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* SECCIONES GENERICAS */

.public-section {
    margin-top: 72px;
}

.public-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 28px;
}

.public-section-title {
    font-size: 26px;
    margin: 0;
}

.public-section-subtitle {
    color: var(--ink-soft);
    margin: 6px 0 0;
}


/* FILTRO ACTIVO */

.public-filter-banner {
    display: flex;
    align-items: center;
    gap: 10px;

    background-color: var(--accent-light);
    color: var(--accent-hover);

    padding: 10px 18px;
    border-radius: 10px;

    font-size: 14px;
    margin-bottom: 20px;
}

.public-filter-banner a {
    color: var(--accent-hover);
    font-weight: 600;
    text-decoration: none;
}

.public-filter-banner a:hover {
    text-decoration: underline;
}


/* COMO FUNCIONA (diagrama de pasos) */

.public-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.public-step {
    flex: 1;
    text-align: center;
    padding: 0 12px;
}

.public-step-number {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c6cf6);
    color: white;
    font-weight: 700;
    font-size: 18px;

    box-shadow: var(--shadow-md);
}

.public-step h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.public-step p {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.public-step-connector {
    flex: 0 0 auto;
    width: 60px;
    height: 2px;
    margin-top: 22px;

    background: repeating-linear-gradient(
        to right,
        var(--border) 0,
        var(--border) 6px,
        transparent 6px,
        transparent 12px
    );
}


/* CATEGORIAS */

.public-category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.public-category-card,
.public-category-card:visited,
.public-category-card:hover,
.public-category-card:active {
    text-decoration: none;
    color: var(--ink);
}

.public-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;

    background-color: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 12px;

    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.public-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--cat-color, var(--accent));
}

.public-category-icon {
    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--cat-color, var(--accent)) 15%, white);

    transition: transform 0.2s ease;
}

.public-category-card:hover .public-category-icon {
    transform: scale(1.1);
}

.public-category-card h3 {
    margin: 0;
    font-size: 15px;
}


/* BANNER DE CATEGORIA */

.public-category-banner {
    background: linear-gradient(135deg, var(--cat-color, var(--accent)), color-mix(in srgb, var(--cat-color, var(--accent)) 60%, white));
    padding: 64px 20px;
    text-align: center;
}

.public-category-banner-content {
    max-width: 640px;
    margin: 0 auto;
}

.public-category-banner-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 34px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.public-category-banner h1 {
    color: white;
    font-size: 34px;
    margin: 0 0 14px;
}

.public-category-banner p {
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}


/* ULTIMOS ARTICULOS */

.public-article-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.public-article-preview-card,
.public-article-preview-card:visited,
.public-article-preview-card:hover,
.public-article-preview-card:active {
    text-decoration: none;
    color: var(--ink);
}

.public-article-preview-card {
    display: block;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;

    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.public-article-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #d1d5db;
}

.public-article-preview-date {
    color: var(--ink-soft);
    font-size: 13px;
}

.public-article-preview-card h3 {
    margin: 8px 0 8px;
    font-size: 17px;
    line-height: 1.35;
}

.public-article-preview-card p {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 14px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* SOBRE MI */

.public-about {
    display: flex;
    align-items: center;
    gap: 32px;

    background-color: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 40px;

    box-shadow: var(--shadow-sm);
}

.public-about-avatar {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), #ede9fe);
}

.public-about-text h2 {
    margin-top: 0;
}

.public-about-text p {
    color: var(--ink-soft);
    line-height: 1.65;
    margin: 0;
}


/* FOOTER */

.public-footer {
    text-align: center;
    color: var(--ink-soft);
    font-size: 14px;

    padding: 50px 20px 40px;
}

.public-footer p {
    margin: 0;
}


@media (max-width: 800px) {

    .public-hero {
        padding: 60px 20px 90px;
    }

    .public-hero h1 {
        font-size: 30px;
    }

    .public-feature-cards {
        grid-template-columns: 1fr;
        margin-top: -40px;
    }

    .public-section {
        margin-top: 52px;
    }

    .public-steps {
        flex-direction: column;
        gap: 24px;
    }

    .public-step-connector {
        display: none;
    }

    .public-article-preview-grid {
        grid-template-columns: 1fr;
    }

    .public-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-about {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
    }

}

.public-nav {
    display: flex;
    flex-wrap: wrap;
    row-gap: 8px;
    gap: 20px;
}

.public-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;

    padding-bottom: 4px;
    border-bottom: 2px solid transparent;

    transition: color 0.15s ease, border-color 0.15s ease;
}

.public-nav a:hover,
.public-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

a.card,
a.card:visited,
a.card:hover,
a.card:active {
    text-decoration: none;
    color: var(--ink);
}

a.card {
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.public-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;

    color: var(--ink-soft);
    font-size: 14px;

    margin: 8px 0 28px;
}

.public-article {
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 14px;

    padding: 32px 40px;
    margin-top: 20px;

    box-shadow: var(--shadow-sm);
}

.public-article h1 {
    margin-top: 0;
}

.public-article-body {
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink);
}

.public-article-body h2 {
    margin-top: 32px;
    font-size: 22px;
}

.public-article-body h3 {
    margin-top: 24px;
    font-size: 18px;
}

.public-article-body p {
    margin: 16px 0;
}

.public-article-body ul,
.public-article-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.public-article-body li {
    margin: 6px 0;
}

.public-article-body blockquote {
    margin: 16px 0;
    padding: 12px 20px;
    border-left: 3px solid var(--accent-light);
    background-color: #fafafa;
    color: var(--ink-soft);
}

.public-article-body code {
    background-color: var(--accent-light);
    color: var(--accent-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.public-article-body pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 16px 20px;
    border-radius: 10px;
    overflow-x: auto;
}

.public-article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.public-article-body a {
    color: var(--accent);
}

.public-article-body img {
    max-width: 100%;
    border-radius: 10px;
}

@media (max-width: 800px) {

    .public-header {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .public-nav {
        gap: 18px;
    }

    .public-article {
        padding: 24px 20px;
    }

}