/* ==========================================================================
   Registro IEPPDCH — sistema de diseño del módulo de registro público
   Paleta tomada de la identidad institucional (carmín, magenta y verde).
   Todo el CSS vive bajo .reg-page para no afectar al resto de la plataforma.
   ========================================================================== */

.reg-page {
    --reg-primary: #b8002e;
    --reg-primary-dark: #8e0023;
    --reg-primary-soft: #fdeaee;
    --reg-accent: #e1006b;
    --reg-teal: #009b87;
    --reg-teal-soft: #e6f6f3;

    --reg-ink: #14181f;
    --reg-body: #3f4854;
    --reg-muted: #6b7480;
    --reg-line: #e3e7ed;
    --reg-line-strong: #cdd4de;
    --reg-surface: #ffffff;
    --reg-canvas: #f5f6f9;

    --reg-radius: 12px;
    --reg-radius-sm: 8px;
    --reg-shadow: 0 1px 2px rgba(20, 24, 31, .06), 0 8px 24px rgba(20, 24, 31, .06);
    --reg-shadow-lift: 0 2px 4px rgba(20, 24, 31, .08), 0 16px 32px rgba(20, 24, 31, .12);

    --reg-font: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    background: var(--reg-canvas);
    color: var(--reg-body);
    font-family: var(--reg-font);
    padding: 0 0 3rem;
    min-height: 100%;
}

.reg-page *,
.reg-page *::before,
.reg-page *::after {
    box-sizing: border-box;
}

.reg-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --------------------------------------------------------------------------
   Encabezado institucional
   -------------------------------------------------------------------------- */

.reg-hero {
    background: var(--reg-surface);
    border-bottom: 1px solid var(--reg-line);
    padding: 1.75rem 0 1.5rem;
    margin-bottom: 1.75rem;
    position: relative;
}

.reg-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: linear-gradient(90deg, var(--reg-primary) 0 33%, var(--reg-accent) 33% 66%, var(--reg-teal) 66% 100%);
}

.reg-hero__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.reg-hero__logo {
    height: 58px;
    width: auto;
    max-width: 100%;
    flex: none;
}

.reg-hero__text {
    flex: 1 1 320px;
    min-width: 0;
}

.reg-hero__eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--reg-primary);
    margin-bottom: .35rem;
}

.reg-hero__title {
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--reg-ink);
    margin: 0 0 .35rem;
}

.reg-hero__subtitle {
    font-size: 1rem;
    color: var(--reg-muted);
    margin: 0;
    max-width: 62ch;
}

/* --------------------------------------------------------------------------
   Indicador de pasos
   -------------------------------------------------------------------------- */

.reg-steps {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    margin: 1.25rem 0 0;
    padding: 0;
}

.reg-steps__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--reg-muted);
}

.reg-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--reg-line);
    color: var(--reg-body);
    font-size: .8rem;
    font-weight: 700;
    flex: none;
}

.reg-steps__item--active {
    color: var(--reg-ink);
}

.reg-steps__item--active .reg-steps__num {
    background: var(--reg-primary);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Layout principal
   -------------------------------------------------------------------------- */

.reg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 992px) {
    .reg-layout--aside {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .reg-aside {
        position: sticky;
        top: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   Tarjetas de sección
   -------------------------------------------------------------------------- */

.reg-card {
    background: var(--reg-surface);
    border: 1px solid var(--reg-line);
    border-radius: var(--reg-radius);
    box-shadow: var(--reg-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.reg-card:last-child {
    margin-bottom: 0;
}

.reg-card__header {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--reg-line);
    background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
}

.reg-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--reg-radius-sm);
    background: var(--reg-primary-soft);
    color: var(--reg-primary);
    font-size: 1rem;
    flex: none;
}

.reg-card__titles {
    min-width: 0;
}

.reg-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--reg-ink);
    margin: 0;
    line-height: 1.35;
}

.reg-card__desc {
    font-size: .875rem;
    color: var(--reg-muted);
    margin: .15rem 0 0;
}

.reg-card__body {
    padding: 1.5rem;
}

.reg-card__footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--reg-line);
    background: #fbfbfc;
}

/* --------------------------------------------------------------------------
   Campos de formulario
   -------------------------------------------------------------------------- */

.reg-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.15rem;
}

.reg-col-12 { grid-column: span 12; }
.reg-col-6  { grid-column: span 12; }
.reg-col-4  { grid-column: span 12; }
.reg-col-8  { grid-column: span 12; }

@media (min-width: 576px) {
    .reg-col-6 { grid-column: span 6; }
    .reg-col-4 { grid-column: span 4; }
    .reg-col-8 { grid-column: span 8; }
}

.reg-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.reg-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--reg-ink);
    margin-bottom: .35rem;
    display: block;
}

.reg-required {
    color: var(--reg-primary);
    font-weight: 700;
    margin-left: .15rem;
}

.reg-hint {
    font-size: .8125rem;
    color: var(--reg-muted);
    margin-top: .35rem;
    line-height: 1.45;
}

.reg-page .form-control,
.reg-page select.form-control {
    height: auto;
    min-height: 44px;
    padding: .55rem .8rem;
    font-size: .95rem;
    color: var(--reg-ink);
    background-color: #fff;
    border: 1px solid var(--reg-line-strong);
    border-radius: var(--reg-radius-sm);
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.reg-page .form-control::placeholder {
    color: #9aa3af;
}

.reg-page .form-control:focus {
    border-color: var(--reg-primary);
    box-shadow: 0 0 0 3px rgba(184, 0, 46, .15);
    outline: none;
}

.reg-page .form-control[readonly] {
    background-color: #f3f5f8;
    color: var(--reg-body);
    cursor: default;
}

.reg-page .form-control[readonly]:focus {
    border-color: var(--reg-line-strong);
    box-shadow: none;
}

.reg-page select.form-control:disabled,
.reg-page .form-control:disabled {
    background-color: #f0f2f5;
    color: var(--reg-muted);
}

/* --------------------------------------------------------------------------
   Bloque de verificación de CURP
   -------------------------------------------------------------------------- */

.reg-curp {
    background: var(--reg-primary-soft);
    border: 1px solid #f6d3db;
    border-radius: var(--reg-radius-sm);
    padding: 1.15rem;
}

.reg-curp__row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
}

.reg-curp__input {
    flex: 1 1 260px;
    min-width: 0;
}

.reg-curp .form-control {
    background: #fff;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}

.reg-curp__actions {
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */

.reg-page .reg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .6rem 1.25rem;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--reg-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.reg-page .reg-btn--primary {
    background: var(--reg-primary);
    border-color: var(--reg-primary);
    color: #fff;
}

.reg-page .reg-btn--primary:hover,
.reg-page .reg-btn--primary:focus {
    background: var(--reg-primary-dark);
    border-color: var(--reg-primary-dark);
    color: #fff;
    text-decoration: none;
}

.reg-page .reg-btn--ghost {
    background: #fff;
    border-color: var(--reg-line-strong);
    color: var(--reg-ink);
}

.reg-page .reg-btn--ghost:hover,
.reg-page .reg-btn--ghost:focus {
    border-color: var(--reg-primary);
    color: var(--reg-primary);
    text-decoration: none;
}

.reg-page .reg-btn--block {
    width: 100%;
}

.reg-page .reg-btn:disabled,
.reg-page .reg-btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Grupos de opciones (sí / no)
   -------------------------------------------------------------------------- */

.reg-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.reg-legend {
    font-size: .875rem;
    font-weight: 600;
    color: var(--reg-ink);
    margin-bottom: .5rem;
    padding: 0;
    width: auto;
    float: none;
    line-height: 1.4;
}

.reg-choices {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.reg-choice {
    position: relative;
}

.reg-choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.reg-choice label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    min-height: 44px;
    padding: .5rem 1rem;
    margin: 0;
    font-size: .925rem;
    font-weight: 600;
    color: var(--reg-body);
    background: #fff;
    border: 1px solid var(--reg-line-strong);
    border-radius: var(--reg-radius-sm);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.reg-choice input:checked + label {
    background: var(--reg-primary-soft);
    border-color: var(--reg-primary);
    color: var(--reg-primary-dark);
}

.reg-choice input:focus-visible + label {
    box-shadow: 0 0 0 3px rgba(184, 0, 46, .2);
}

/* Casilla de aceptación */

.reg-check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
}

.reg-check input {
    width: 20px;
    height: 20px;
    margin-top: .15rem;
    flex: none;
    accent-color: var(--reg-primary);
    cursor: pointer;
}

.reg-check label {
    margin: 0;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--reg-body);
    cursor: pointer;
}

.reg-page a {
    color: var(--reg-primary);
    text-decoration: underline;
}

.reg-page a:hover {
    color: var(--reg-primary-dark);
}

/* --------------------------------------------------------------------------
   Oferta académica: selector y tarjetas
   -------------------------------------------------------------------------- */

.reg-posgrados__select {
    max-width: 640px;
}

.reg-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.15rem;
    margin-top: 1.5rem;
}

.posgrado-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    background: #fff;
    border: 1px solid var(--reg-line);
    border-radius: var(--reg-radius);
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.posgrado-card:hover {
    border-color: var(--reg-line-strong);
    box-shadow: var(--reg-shadow-lift);
    transform: translateY(-2px);
}

.posgrado-card:focus-within {
    box-shadow: var(--reg-shadow-lift);
}

.posgrado-card.is-selected {
    border-color: var(--reg-primary);
    box-shadow: 0 0 0 2px rgba(184, 0, 46, .18), var(--reg-shadow);
}

.posgrado-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #eef1f5;
    overflow: hidden;
}

/* Respaldo para navegadores sin aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .posgrado-card__media {
        height: 150px;
    }
}

.posgrado-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.posgrado-card__tag {
    position: absolute;
    top: .6rem;
    left: .6rem;
    background: rgba(20, 24, 31, .82);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 999px;
}

.posgrado-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1rem 1.1rem 1.15rem;
}

.posgrado-card__title {
    font-size: .975rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--reg-ink);
    margin: 0 0 .5rem;
}

.posgrado-card__meta {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: .825rem;
    color: var(--reg-muted);
}

.posgrado-card__meta li {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-bottom: .2rem;
}

.posgrado-card__meta i {
    color: var(--reg-teal);
    width: 14px;
    flex: none;
    text-align: center;
}

.posgrado-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    min-height: 42px;
    padding: .5rem .9rem;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 700;
    color: var(--reg-primary);
    background: #fff;
    border: 1px solid var(--reg-primary);
    border-radius: var(--reg-radius-sm);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.posgrado-card__cta:hover {
    background: var(--reg-primary-soft);
}

.posgrado-card__cta-on {
    display: none;
}

.posgrado-card__cta[aria-pressed="true"] {
    background: var(--reg-teal);
    border-color: var(--reg-teal);
    color: #fff;
}

.posgrado-card__cta[aria-pressed="true"] .posgrado-card__cta-on {
    display: inline;
}

.posgrado-card__cta[aria-pressed="true"] .posgrado-card__cta-idle {
    display: none;
}

/* --------------------------------------------------------------------------
   Panel lateral
   -------------------------------------------------------------------------- */

.reg-aside__card {
    background: var(--reg-surface);
    border: 1px solid var(--reg-line);
    border-radius: var(--reg-radius);
    box-shadow: var(--reg-shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.reg-aside__title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--reg-muted);
    margin: 0 0 .75rem;
}

.reg-aside__value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--reg-ink);
    line-height: 1.4;
    margin: 0;
}

.reg-aside__empty {
    font-size: .9rem;
    color: var(--reg-muted);
    margin: 0;
}

.reg-aside__list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .9rem;
}

.reg-aside__list li {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    padding: .5rem 0;
    border-bottom: 1px solid var(--reg-line);
    line-height: 1.45;
}

.reg-aside__list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.reg-aside__list i {
    color: var(--reg-teal);
    margin-top: .2rem;
    flex: none;
}

/* --------------------------------------------------------------------------
   Avisos
   -------------------------------------------------------------------------- */

.reg-alert {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .9rem 1.1rem;
    border-radius: var(--reg-radius-sm);
    font-size: .9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.reg-alert i {
    margin-top: .15rem;
    flex: none;
}

.reg-alert--error {
    background: var(--reg-primary-soft);
    border-color: #f3c6d1;
    color: #7a0021;
}

.reg-alert--info {
    background: var(--reg-teal-soft);
    border-color: #bfe6df;
    color: #08594d;
}

.reg-alert__list {
    margin: .35rem 0 0;
    padding-left: 1.1rem;
}

.reg-alert__title {
    font-weight: 700;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Utilidades
   -------------------------------------------------------------------------- */

.reg-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reg-page :focus-visible {
    outline: 3px solid rgba(184, 0, 46, .35);
    outline-offset: 2px;
}

.reg-divider {
    height: 1px;
    background: var(--reg-line);
    border: 0;
    margin: 1.5rem 0;
}

.reg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.reg-actions__submit {
    flex: 0 0 auto;
    min-width: 200px;
}

@media (max-width: 575.98px) {
    .reg-hero__title {
        font-size: 1.4rem;
    }

    .reg-card__header,
    .reg-card__body,
    .reg-card__footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .reg-actions__submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reg-page *,
    .reg-page *::before,
    .reg-page *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }

    .posgrado-card:hover {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Pantalla de redirección posterior al registro
   -------------------------------------------------------------------------- */

.reg-redirect {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    min-height: 60vh;
    padding: 2rem 1rem;
}

.reg-redirect__spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--reg-line);
    border-top-color: var(--reg-primary);
    border-radius: 50%;
    animation: reg-spin .9s linear infinite;
}

@keyframes reg-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .reg-redirect__spinner {
        animation: none;
    }
}
