:root {
    --ius-black: #090909;
    --ius-black-soft: #171717;
    --ius-gold: #c79a3b;
    --ius-gold-dark: #9e7426;
    --ius-gold-soft: #f5ead1;
    --ius-ivory: #f8f6f1;
    --ius-ink: #242321;
    --ius-muted: #6d6a64;
    --ius-border: #e6e0d5;
    --ius-radius: 1.1rem;
    --ius-shadow: 0 18px 55px rgba(16, 13, 8, .10);
}

html { scroll-behavior: smooth; }
body {
    color: var(--ius-ink);
    background: #fff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ius-gold-dark); }
a:hover { color: #795719; }

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 2000;
    padding: .75rem 1rem;
    background: #fff;
    color: #111;
    border-radius: .5rem;
}
.skip-link:focus { top: 1rem; }

.ius-navbar {
    background: rgba(9, 9, 9, .96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.10);
}
.ius-navbar .navbar-brand img { width: min(310px, 66vw); height: auto; }
.ius-navbar .nav-link { color: rgba(255,255,255,.78); font-weight: 600; }
.ius-navbar .nav-link:hover, .ius-navbar .nav-link:focus { color: #fff; }

.btn-ius {
    --bs-btn-color: #111;
    --bs-btn-bg: var(--ius-gold);
    --bs-btn-border-color: var(--ius-gold);
    --bs-btn-hover-color: #111;
    --bs-btn-hover-bg: #d6ad55;
    --bs-btn-hover-border-color: #d6ad55;
    --bs-btn-active-bg: var(--ius-gold-dark);
    --bs-btn-active-border-color: var(--ius-gold-dark);
    font-weight: 750;
    letter-spacing: .01em;
}
.btn-outline-ius {
    --bs-btn-color: var(--ius-gold-dark);
    --bs-btn-border-color: var(--ius-gold);
    --bs-btn-hover-color: #111;
    --bs-btn-hover-bg: var(--ius-gold);
    --bs-btn-hover-border-color: var(--ius-gold);
    font-weight: 700;
}

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 76% 18%, rgba(199,154,59,.28), transparent 28%),
        radial-gradient(circle at 15% 85%, rgba(199,154,59,.12), transparent 28%),
        linear-gradient(135deg, #050505 0%, #111 52%, #1d1a14 100%);
    color: #fff;
    padding: 7rem 0 5.5rem;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    text-transform: uppercase;
    letter-spacing: .15em;
    font-weight: 800;
    font-size: .78rem;
    color: #e1be73;
}
.eyebrow::before { content: ""; width: 2.1rem; height: 2px; background: var(--ius-gold); }
.hero h1 { font-size: clamp(2.45rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.055em; font-weight: 830; }
.hero-subtitle { color: #dfbd77; font-size: clamp(1.2rem, 2.1vw, 1.75rem); font-weight: 650; }
.hero-copy { color: rgba(255,255,255,.76); font-size: 1.08rem; max-width: 58rem; }
.hero-panel {
    background: rgba(255,255,255,.075);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 1.35rem;
    padding: 1.5rem;
    box-shadow: 0 26px 70px rgba(0,0,0,.28);
}
.hero-stat { border-left: 3px solid var(--ius-gold); padding-left: 1rem; }
.hero-stat strong { display: block; font-size: 1.05rem; color: #fff; }
.hero-stat span { color: rgba(255,255,255,.64); font-size: .9rem; }

.section { padding: 5.3rem 0; }
.section-soft { background: var(--ius-ivory); }
.section-dark { background: var(--ius-black); color: #fff; }
.section-title { font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.04em; font-weight: 800; }
.section-lead { color: var(--ius-muted); font-size: 1.08rem; max-width: 52rem; }
.section-dark .section-lead { color: rgba(255,255,255,.68); }

.feature-card, .registration-card, .speaker-card, .form-card, .admin-card {
    background: #fff;
    border: 1px solid var(--ius-border);
    border-radius: var(--ius-radius);
    box-shadow: 0 10px 32px rgba(20,16,8,.055);
}
.feature-card { padding: 1.6rem; height: 100%; }
.feature-number {
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: .8rem;
    background: var(--ius-gold-soft);
    color: var(--ius-gold-dark);
    font-weight: 850;
}

.registration-card { padding: 2rem; height: 100%; transition: transform .2s ease, box-shadow .2s ease; }
.registration-card:hover { transform: translateY(-4px); box-shadow: var(--ius-shadow); }
.registration-card.external { border-top: 4px solid var(--ius-gold); }
.registration-card.internal { border-top: 4px solid #171717; }
.price { font-size: 2.2rem; letter-spacing: -.04em; font-weight: 850; }

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 1rem; top: .4rem; bottom: .4rem; width: 2px; background: #dcc99f; }
.timeline-day { position: relative; padding-left: 3.25rem; margin-bottom: 2.35rem; }
.timeline-day::before {
    content: "";
    position: absolute;
    left: .57rem;
    top: .2rem;
    width: .9rem;
    height: .9rem;
    border-radius: 50%;
    background: var(--ius-gold);
    box-shadow: 0 0 0 6px var(--ius-gold-soft);
}
.session-row { padding: 1rem 0; border-bottom: 1px solid var(--ius-border); }
.session-row:last-child { border-bottom: 0; }
.session-time { font-weight: 800; color: var(--ius-gold-dark); white-space: nowrap; }

.speaker-card { overflow: hidden; height: 100%; }
.speaker-card-header { padding: 1.55rem 1.65rem; background: #111; color: #fff; border-bottom: 4px solid var(--ius-gold); }
.speaker-card-body { padding: 1.65rem; }
.speaker-initials {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ius-gold);
    color: #111;
    font-weight: 900;
    font-size: 1.15rem;
}

.venue-box {
    border-radius: 1.4rem;
    background: linear-gradient(135deg, #121212, #242019);
    color: #fff;
    padding: clamp(2rem, 5vw, 3.5rem);
    box-shadow: var(--ius-shadow);
}
.venue-box .muted { color: rgba(255,255,255,.68); }

.form-shell { background: var(--ius-ivory); min-height: 70vh; padding: 3.5rem 0 5rem; }
.form-card { overflow: hidden; box-shadow: var(--ius-shadow); }
.form-card-header { background: #101010; color: #fff; padding: 2rem; border-bottom: 4px solid var(--ius-gold); }
.form-card-body { padding: clamp(1.4rem, 4vw, 2.5rem); }
.form-section { padding: 1.5rem 0; border-bottom: 1px solid var(--ius-border); }
.form-section:last-child { border-bottom: 0; padding-bottom: 0; }
.form-section-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 1.1rem; }
.form-label { font-weight: 700; color: #34312c; }
.form-control, .form-select {
    min-height: 3rem;
    border-color: #d7d0c4;
    border-radius: .7rem;
}
textarea.form-control { min-height: 7rem; }
.form-control:focus, .form-select:focus { border-color: var(--ius-gold); box-shadow: 0 0 0 .2rem rgba(199,154,59,.20); }
.form-check-input:checked { background-color: var(--ius-gold-dark); border-color: var(--ius-gold-dark); }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.upload-box { border: 2px dashed #cfbf9d; border-radius: .9rem; padding: 1.25rem; background: #fdfbf7; }
.info-panel { background: var(--ius-gold-soft); border: 1px solid #dfc68f; border-radius: .9rem; padding: 1.2rem; }

.ius-footer { background: #080808; color: rgba(255,255,255,.66); padding: 2.6rem 0; }
.ius-footer img { width: min(300px, 72vw); }
.ius-footer a { color: #e1bd70; }

/* Admin */
.admin-body { background: #f4f3ef; min-height: 100vh; }
.admin-shell { min-height: 100vh; }
.admin-sidebar {
    width: 280px;
    background: #0b0b0b;
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1035;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.08);
}
.admin-sidebar-logo { padding: 1.45rem 1.25rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.09); }
.admin-sidebar-logo img { width: 220px; max-width: 100%; }
.admin-nav { padding: 1rem; }
.admin-nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .15em; color: rgba(255,255,255,.38); padding: .8rem .75rem .4rem; font-weight: 800; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .72rem .8rem;
    border-radius: .65rem;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-weight: 650;
    margin-bottom: .2rem;
}
.admin-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a.active { background: var(--ius-gold); color: #111; }
.admin-nav .nav-mark { width: 1.45rem; text-align: center; font-weight: 900; }
.admin-main { margin-left: 280px; min-width: 0; }
.admin-topbar {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e0d7;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.admin-content { padding: 2rem; }
.admin-card { padding: 1.35rem; }
.metric-card { position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 80px; height: 80px; border-radius: 50%; background: var(--ius-gold-soft); right: -25px; top: -28px; }
.metric-label { color: var(--ius-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.metric-value { font-size: 2.1rem; font-weight: 850; letter-spacing: -.04em; }
.table-admin { --bs-table-bg: transparent; }
.table-admin thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ius-muted); border-bottom-width: 1px; white-space: nowrap; }
.table-admin td { vertical-align: middle; }
.folio { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .86rem; }
.avatar {
    width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--ius-gold-soft); color: var(--ius-gold-dark); font-weight: 850; flex: 0 0 auto;
}
.admin-section-title { font-size: 1.1rem; font-weight: 800; }
.detail-list dt { color: var(--ius-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.detail-list dd { margin-bottom: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.empty-state { text-align: center; padding: 3.2rem 1rem; color: var(--ius-muted); }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; margin-right: .35rem; }

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 78% 20%, rgba(199,154,59,.28), transparent 28%),
        linear-gradient(135deg, #050505, #17140f);
    display: grid;
    place-items: center;
    padding: 1.25rem;
}
.auth-card { width: min(100%, 450px); background: #fff; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 30px 100px rgba(0,0,0,.38); }
.auth-card-brand { background: #090909; padding: 1.65rem 2rem; text-align: center; border-bottom: 4px solid var(--ius-gold); }
.auth-card-brand img { width: 310px; max-width: 100%; }
.auth-card-body { padding: 2rem; }

@media (max-width: 991.98px) {
    .hero { padding-top: 5rem; }
    .admin-sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .admin-sidebar.show { transform: translateX(0); box-shadow: 15px 0 50px rgba(0,0,0,.28); }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 1.25rem; }
}

@media (max-width: 575.98px) {
    .section { padding: 4rem 0; }
    .registration-card, .feature-card { padding: 1.35rem; }
    .hero h1 { font-size: 2.65rem; }
    .form-card-body { padding: 1.15rem; }
    .admin-content { padding: 1rem .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Vista segura de correos administrativos */
.email-preview-frame {
    display: block;
    width: 100%;
    min-height: 640px;
    border: 1px solid var(--ius-border, #ddd8ce);
    border-radius: 1rem;
    background: #fff;
}

.email-text-preview {
    max-height: 480px;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--ius-border, #ddd8ce);
    border-radius: .85rem;
    background: #f8f7f3;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: .86rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Diagnóstico de despliegue */
.health-row {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: .95rem 0;
    border-bottom: 1px solid var(--ius-border);
}
.health-row:first-child { padding-top: 0; }
.health-row:last-child { padding-bottom: 0; border-bottom: 0; }
.health-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .75rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-weight: 900;
    font-size: 1rem;
}
.health-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}
.health-ok { background: #dff3e7 !important; color: #17603a !important; }
.health-warning { background: #fff1c9 !important; color: #755200 !important; }
.health-error { background: #fde1e1 !important; color: #8a2020 !important; }
.health-info { background: #e4edf7 !important; color: #284f78 !important; }
.code-panel {
    margin: 0 0 1rem;
    padding: 1rem;
    border-radius: .85rem;
    background: #121212;
    color: #f7e8c8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .76rem;
}
