* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar / Tab bar ── */
.public-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 56px;
    background: rgba(13, 13, 15, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.public-nav a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 28px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}

.public-nav a:hover {
    color: var(--text-primary);
}

.public-nav a.active {
    color: var(--amber);
    border-bottom-color: var(--amber);
}

/* ── Content area ── */
.public-content {
    padding-top: 56px;
    min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Hero (inicio partial) ── */
.hero {
    height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
        url('/static/img/hero.jpg') center/cover no-repeat;
}

.hero-content {
    max-width: 720px;
    padding: 0 24px;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--amber);
    font-weight: 500;
    letter-spacing: 0.08em;
    margin-bottom: 32px;
}

.hero .btn-cta {
    display: inline-block;
    padding: 14px 40px;
    background: var(--amber);
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
}

.hero .btn-cta:hover {
    background: var(--amber-dim);
    transform: translateY(-2px);
}

/* ── About section ── */
.about-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 80px 24px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 60px;
    align-items: center;
}

.about-portrait {
    display: flex;
    justify-content: center;
}

.portrait-frame {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 3px solid var(--amber);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portrait-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.8;
    margin-bottom: 24px;
}

/* ── Pills ── */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--amber);
    letter-spacing: 0.02em;
}

/* ── Cards section ── */
.cards-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card {
    display: block;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 36px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    border-color: var(--amber);
    box-shadow: 0 0 24px rgba(245, 166, 35, 0.15);
    transform: translateY(-4px);
}

.card-locked {
    opacity: 0.55;
}

.card-locked:hover {
    opacity: 0.8;
    border-color: var(--border);
    box-shadow: none;
    transform: none;
}

.card-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 12px;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Login section ── */
.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 40px 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 40px 32px;
}

.login-card h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 28px;
}

.login-card label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.login-card input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 20px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition);
}

.login-card input:focus {
    border-color: var(--amber);
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: var(--amber);
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
}

.login-card button:hover {
    background: var(--amber-dim);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--amber);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    text-align: center;
}

.flash.error {
    background: rgba(255, 70, 70, 0.12);
    color: #ff6b6b;
    border: 1px solid rgba(255, 70, 70, 0.25);
}

.flash.success {
    background: rgba(70, 255, 70, 0.1);
    color: #6bff6b;
    border: 1px solid rgba(70, 255, 70, 0.2);
}

/* ── Store section ── */
.store-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 24px;
}

.store-section h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}

.store-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 40px;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.store-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.store-card:hover {
    border-color: var(--amber);
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.1);
}

.store-card-img {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.store-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-img-placeholder {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--text-muted);
}

.store-card-body {
    padding: 20px;
}

.store-card-body h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.store-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.store-price {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--amber);
    font-weight: 500;
    margin-bottom: 16px;
}

.btn-contact {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--amber);
    color: var(--amber);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.btn-contact:hover {
    background: var(--amber);
    color: var(--bg-deep);
}

/* ── Store empty ── */
.store-empty {
    text-align: center;
    padding: 60px 24px;
}

.store-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.store-empty p {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.store-empty span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 460px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ── Contact form ── */
.contact-form h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--amber);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    width: 100%;
    padding: 12px;
    background: var(--amber);
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
}

.contact-form button:hover {
    background: var(--amber-dim);
}

.contact-ok {
    text-align: center;
    color: #6bff6b;
    font-size: 1rem;
    padding: 20px 0;
}

/* ── Multimedia section ── */
.media-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 24px;
}

.media-section h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}

.media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 32px;
}

.media-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.media-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-deep);
}

.media-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.media-player--audio {
    aspect-ratio: auto;
    padding: 32px 20px;
    display: flex;
    align-items: center;
}

.media-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.media-info h3 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
}

.media-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.media-type--video {
    background: rgba(70, 70, 255, 0.12);
    color: #6b6bff;
    border: 1px solid rgba(70, 70, 255, 0.2);
}

.media-type--audio {
    background: rgba(245, 166, 35, 0.12);
    color: var(--amber);
    border: 1px solid rgba(245, 166, 35, 0.2);
}

/* ── Portal navbar extras ── */
#portal-nav {
    justify-content: space-between;
    padding: 0 20px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.portal-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--amber);
    color: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.portal-username {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.portal-tabs {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
}

.portal-logout {
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
    padding: 0 12px !important;
    flex-shrink: 0;
}

.portal-logout:hover {
    color: var(--text-primary) !important;
}

/* ── Familia section ── */
.familia-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px;
}

.familia-section h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.familia-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.familia-hint {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.familia-external-link {
    display: inline-block;
    padding: 12px 28px;
    background: var(--bg-surface);
    border: 1px solid var(--amber);
    border-radius: var(--radius);
    color: var(--amber);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.familia-external-link:hover {
    background: var(--amber);
    color: var(--bg-deep);
}

/* ── Familia form ── */
.familia-form {
    margin-bottom: 32px;
}

.familia-form textarea,
.familia-form input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

.familia-form textarea:focus,
.familia-form input:focus {
    border-color: var(--amber);
}

.familia-form button {
    padding: 10px 24px;
    background: var(--amber);
    color: var(--bg-deep);
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.familia-form button:hover {
    background: var(--amber-dim);
}

/* ── Familia posts ── */
.familia-post {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.familia-post.pinned {
    border-color: var(--amber);
    box-shadow: 0 0 12px rgba(245, 166, 35, 0.08);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.post-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.post-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.post-pinned-badge {
    font-size: 0.7rem;
    background: rgba(245, 166, 35, 0.15);
    color: var(--amber);
    padding: 2px 10px;
    border-radius: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-body {
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.evento-title {
    font-weight: 600;
}

/* ── Alumno extras ── */
.familia-post.vencida {
    border-color: rgba(255, 70, 70, 0.3);
}

.vencida-date {
    color: #ff6b6b !important;
}

.msg-sent {
    border-left: 3px solid var(--amber);
}

.msg-received {
    border-left: 3px solid var(--text-muted);
}

.archivos-lista .familia-post {
    cursor: default;
}

.familia-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    .pills {
        justify-content: center;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #portal-nav {
        padding: 0 8px;
    }

    .portal-brand .portal-username {
        display: none;
    }

    .portal-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .portal-tabs::-webkit-scrollbar {
        display: none;
    }

    .public-nav a {
        padding: 0 12px;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .portal-logout {
        padding: 0 8px !important;
        font-size: 0.75rem !important;
    }
}
