/* ==========================================================================
   Plataforma de registro CITCA · Identidad gráfica TecNM / CENIDET
   Color institucional: azul Pantone 294 C (#002F6C) · Tipografía: Montserrat
   Para ajustar el tono, cambia las variables de :root.
   ========================================================================== */

:root {
    --azul:        #002F6C;   /* Pantone 294 C */
    --azul-oscuro: #001B40;
    --azul-medio:  #1C5CB3;
    --azul-suave:  #E8EEF7;
    --azul-borde:  #C9D6EA;

    --texto:       #1B2733;
    --texto-suave: #556575;
    --linea:       #DDE3EB;
    --fondo:       #F4F6FA;
    --blanco:      #FFFFFF;

    --ok:          #1E7B4B;
    --error:       #B3261E;
    --aviso:       #8A5A00;

    --radio:       12px;
    --sombra:      0 10px 30px rgba(0, 47, 108, .10);
    --fuente:      'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--fuente);
    font-size: 15px;
    line-height: 1.6;
    color: var(--texto);
    background: var(--fondo);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--azul-medio); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; color: var(--azul); font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.skip {
    position: absolute; left: -999px; top: 8px; z-index: 100;
    background: var(--azul); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; text-decoration: none; }

/* ---------- Barra superior ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--linea);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--azul); }
.brand:hover { text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; padding-left: 12px; border-left: 2px solid var(--azul-borde); }
.brand-text strong { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: var(--azul); }
.brand-text small { white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--texto-suave); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
    white-space: nowrap; padding: 8px 12px; border-radius: 8px;
    font-size: 13.5px; font-weight: 600; color: var(--texto);
}
.nav a:hover { background: var(--azul-suave); color: var(--azul); text-decoration: none; }
.nav a.activo { color: var(--azul); box-shadow: inset 0 -3px 0 var(--azul); border-radius: 0; }
.nav a.nav-cta { background: var(--azul); color: #fff; margin-left: 6px; border-radius: 999px; padding: 8px 18px; }
.nav a.nav-cta:hover { background: var(--azul-oscuro); color: #fff; }
.nav .nav-user { font-size: 12.5px; color: var(--texto-suave); padding: 0 8px 0 12px; border-left: 1px solid var(--linea); margin-left: 6px; }

.nav-toggle {
    display: none; background: var(--azul); color: #fff; border: 0; border-radius: 8px;
    padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ---------- Portada ---------- */
.hero {
    color: #fff;
    background:
        radial-gradient(900px 300px at 85% -10%, rgba(255, 255, 255, .12), transparent 60%),
        linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul) 55%, var(--azul-medio) 130%);
    padding: 56px 0 110px;
}
.hero-compacto { padding: 34px 0 84px; }
.badge {
    display: inline-block; padding: 6px 14px; margin-bottom: 18px;
    font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .32); border-radius: 999px;
}
.badge-cerrado { background: rgba(179, 38, 30, .35); border-color: rgba(255, 255, 255, .4); }
.hero h1 { color: #fff; font-weight: 800; font-size: clamp(1.6rem, 3.6vw, 2.5rem); max-width: 860px; margin-bottom: .4em; }
.hero-compacto h1 { font-size: clamp(1.4rem, 3vw, 2rem); }
.hero-texto { max-width: 720px; color: rgba(255, 255, 255, .88); font-size: 16px; margin-bottom: 1.2em; }
.hero-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 14px; font-weight: 600; }
.hero-meta li::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: #fff; opacity: .75; }

.main { padding-bottom: 60px; }
.overlap { margin-top: -64px; position: relative; }

/* ---------- Tarjetas ---------- */
.card {
    background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio);
    box-shadow: var(--sombra); padding: 30px;
}
.card h2 { font-size: 22px; }
.kicker { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--azul-medio); }
.hint { color: var(--texto-suave); font-size: 13px; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; max-width: 960px; margin: 0 auto; }
.auth-alt { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--linea); text-align: center; color: var(--texto-suave); }
.auth-alt p { margin-bottom: 12px; }
.auth-solo { max-width: 780px; margin: 0 auto; }

.timeline { list-style: none; margin: 18px 0 20px; padding: 0; counter-reset: paso; }
.timeline li { position: relative; padding: 0 0 20px 50px; counter-increment: paso; }
.timeline li::before {
    content: counter(paso); position: absolute; left: 0; top: 0; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--azul-suave); color: var(--azul); font-weight: 800; border-radius: 50%; border: 1px solid var(--azul-borde);
}
.timeline li::after { content: ''; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--azul-borde); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline strong { display: block; color: var(--azul); font-size: 14.5px; }
.timeline span { color: var(--texto-suave); font-size: 13.5px; }
.timeline li:first-child::before { background: var(--azul); color: #fff; border-color: var(--azul); }
.enlaces-autor { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; font-weight: 600; }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 20px; }
.span-12 { grid-column: span 12; }
.span-8  { grid-column: span 8; }
.span-7  { grid-column: span 7; }
.span-6  { grid-column: span 6; }
.span-5  { grid-column: span 5; }
.span-4  { grid-column: span 4; }
.field { margin-bottom: 18px; }
.form-grid .field { margin-bottom: 0; }
.field label, .label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--azul); }
.input, .select, .textarea {
    width: 100%; padding: 11px 13px; font: inherit; font-size: 15px; color: var(--texto);
    background: #fff; border: 1.5px solid var(--azul-borde); border-radius: 9px;
    transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--azul-medio); box-shadow: 0 0 0 4px rgba(28, 92, 179, .16);
}
.input[readonly] { background: var(--azul-suave); color: var(--texto-suave); }
.input::placeholder, .textarea::placeholder { color: #93A0AE; }
input[type="file"].input { padding: 9px; background: var(--fondo); }
input[type="radio"] { accent-color: var(--azul); width: 18px; height: 18px; }

.form-seccion { margin: 8px 0 0; padding-top: 22px; border-top: 1px solid var(--linea); }
.form-seccion h3 { font-size: 17px; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; margin: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
    display: inline-block; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
    color: var(--azul); background: #fff; border: 1.5px solid var(--azul-borde); border-radius: 999px;
    transition: background .15s, color .15s, border-color .15s;
}
.choice:hover span { background: var(--azul-suave); }
.choice input:checked + span { background: var(--azul); color: #fff; border-color: var(--azul); }
.choice input:focus-visible + span { outline: 3px solid rgba(28, 92, 179, .4); outline-offset: 2px; }

.notas { background: var(--azul-suave); border-left: 4px solid var(--azul); border-radius: 8px; padding: 14px 18px; font-size: 13.5px; color: var(--texto); }
.notas p { margin: 0 0 6px; }
.notas p:last-child { margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--linea); border-radius: 10px; }
.tabla { width: 100%; border-collapse: collapse; background: #fff; }
.tabla th {
    background: var(--azul); color: #fff; text-align: left; font-size: 12.5px; font-weight: 700;
    letter-spacing: .4px; padding: 11px 10px; white-space: nowrap;
}
.tabla td { padding: 8px 10px; border-top: 1px solid var(--linea); vertical-align: middle; }
.tabla tbody tr:nth-child(even) { background: #FAFBFD; }
.tabla tbody tr:hover { background: var(--azul-suave); }
.tabla-autores { min-width: 1020px; }
.tabla-autores .input, .tabla-autores .select { padding: 8px 10px; font-size: 14px; }
.tabla-autores .select { min-width: 150px; }
.tabla .centro { text-align: center; }

.acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Botones ---------- */
.btn {
    display: inline-block; padding: 12px 24px; font: inherit; font-size: 14.5px; font-weight: 700;
    text-align: center; cursor: pointer; border-radius: 999px; border: 2px solid var(--azul);
    transition: background .15s, color .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-oscuro); border-color: var(--azul-oscuro); color: #fff; }
.btn-outline { background: #fff; color: var(--azul); }
.btn-outline:hover { background: var(--azul-suave); color: var(--azul); }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 30px; font-size: 15.5px; }

/* ---------- Avisos ---------- */
.alert { border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-size: 14px; border: 1px solid; }
.alert strong { font-weight: 700; }
.alert ul { margin: 8px 0 0 18px; padding: 0; }
.alert-danger  { background: #FDECEA; border-color: #F3B8B3; color: #7A1712; }
.alert-success { background: #E7F5EE; border-color: #A9D9C0; color: #14532F; }
.alert-warning { background: #FFF6E0; border-color: #F0D58C; color: #6B4600; }
.alert-info    { background: var(--azul-suave); border-color: var(--azul-borde); color: var(--azul); }
.codigo-big { font-size: 34px; font-weight: 800; letter-spacing: 1.5px; color: var(--azul); margin: 8px 0 12px; }

.resumen { width: 100%; border-collapse: collapse; margin: 20px 0; }
.resumen th, .resumen td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--linea); vertical-align: top; }
.resumen th { width: 30%; color: var(--azul); background: var(--azul-suave); font-size: 13px; }

.estado { display: inline-block; padding: 3px 11px; font-size: 12px; font-weight: 700; border-radius: 999px; background: var(--azul-suave); color: var(--azul); }
.estado-ok { background: #E7F5EE; color: var(--ok); }
.vacio { text-align: center; padding: 40px 20px; color: var(--texto-suave); }
.panel-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-cab h2 { margin: 0; }

/* ---------- Pie de página ---------- */
.footer { background: var(--azul-oscuro); color: rgba(255, 255, 255, .82); font-size: 14px; }
.footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding: 52px 0 36px; }
.footer h4 { color: #fff; font-size: 13px; letter-spacing: 1.1px; text-transform: uppercase; margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.logos-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: #fff; padding: 14px 18px; border-radius: 12px; width: fit-content; margin-bottom: 16px; }
.logos-pie img { height: 44px; width: auto; display: block; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .14); padding: 18px 0; font-size: 12.5px; color: rgba(255, 255, 255, .65); }

/* ---------- Adaptación a pantallas pequeñas ---------- */
@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .nav-toggle { display: inline-block; }
    .nav {
        display: none; position: absolute; left: -20px; right: -20px; top: 100%;
        flex-direction: column; align-items: stretch; gap: 2px;
        background: #fff; border-bottom: 1px solid var(--linea); padding: 10px 20px 16px;
        box-shadow: 0 12px 20px rgba(0, 47, 108, .08);
    }
    .nav.abierto { display: flex; }
    .nav a.activo { box-shadow: none; background: var(--azul-suave); border-radius: 8px; }
    .nav a.nav-cta { margin: 6px 0 0; text-align: center; }
    .nav .nav-user { border: 0; margin: 0; padding: 8px 12px; }
}
@media (max-width: 700px) {
    .card { padding: 22px 18px; }
    .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
    .brand img { height: 38px; }
    .brand-text small { display: none; }
    .hero { padding: 38px 0 96px; }
    .btn-lg { width: 100%; }
    .acciones .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
