@font-face {
    font-family: 'Patria';
    src: url('Estilos Institucionales/tipografias/Patria_Regular.otf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Patria';
    src: url('Estilos Institucionales/tipografias/Patria_Bold.otf') format('opentype');
    font-weight: 700;
}

@font-face {
    font-family: 'Noto Sans Local';
    src: url('Estilos Institucionales/tipografias/NotoSans-Regular.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'Noto Sans Local';
    src: url('Estilos Institucionales/tipografias/NotoSans-Bold.ttf') format('truetype');
    font-weight: 700;
}

:root {
    --page-bg: #f4f7fa;
    --panel-border: rgba(15, 23, 42, 0.08);
    --panel-shadow: 0 18px 40px -34px rgba(15, 23, 42, 0.22);
    --field-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.14);
    --danger: #b42318;
    --warning: #b54708;
    --success: #027a48;
    --ink-soft: #5f6670;
    --surface-strong: #ffffff;
    --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
    background: #f4f7fa;
}

body {
    font-family: 'Noto Sans Local', var(--font-sans);
    background: var(--page-bg);
    color: var(--color-text-primary);
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.animate-soft {
    animation-duration: 0.55s;
    animation-fill-mode: both;
    animation-timing-function: var(--motion-ease);
}

.animate-fade-in-up {
    animation-name: softFadeInUp;
}

.animate-delay-1 {
    animation-delay: 0.08s;
}

.animate-delay-2 {
    animation-delay: 0.16s;
}

@keyframes softFadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.shell {
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(165, 127, 44, 0.26);
}

.page-header::after {
    content: '';
    display: block;
    height: 3px;
    background: var(--gobmx-guinda);
}

.page-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.brand-lockup__logo--gob {
    width: clamp(118px, 16vw, 165px);
}

.brand-lockup__logo--sener {
    width: clamp(120px, 16vw, 168px);
}

.brand-lockup__divider {
    width: 1px;
    height: 40px;
    background: rgba(152, 152, 154, 0.45);
}

.section-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
}

.section-kicker {
    color: var(--gobmx-guinda);
}

.page-main {
    padding: 2rem 0 3rem;
}

.form-card {
    background: var(--surface-strong);
    border: 1px solid var(--panel-border);
    box-shadow: var(--panel-shadow);
    border-radius: 24px;
}

.form-card__header h2,
.form-section__title,
.procedure-card__title {
    font-family: 'Patria', var(--font-heading);
}

.workspace-grid {
    display: block;
}

.form-card {
    padding: 1.5rem;
}

.form-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-card__header h2 {
    margin: 0.4rem 0 0;
    color: var(--gobmx-guinda);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.08;
}

.form-card__institution {
    margin-top: 0.5rem;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.45;
}

.form-card__institution p {
    margin: 0;
}

.notice-banner {
    border-radius: 16px;
    padding: 0.95rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    font-weight: 700;
}

.notice-banner--info {
    background: rgba(30, 91, 79, 0.08);
    color: var(--gobmx-verde);
    border-color: rgba(30, 91, 79, 0.18);
}

.notice-banner--warning {
    background: rgba(181, 71, 8, 0.09);
    color: var(--warning);
    border-color: rgba(181, 71, 8, 0.2);
}

.notice-banner--error {
    background: rgba(180, 35, 24, 0.08);
    color: var(--danger);
    border-color: rgba(180, 35, 24, 0.18);
}

.notice-banner--success {
    background: rgba(2, 122, 72, 0.08);
    color: var(--success);
    border-color: rgba(2, 122, 72, 0.18);
}

.stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stepper__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 58px;
    padding: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    background: #ffffff;
    color: var(--color-text-secondary);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    animation: softFadeInUp 0.45s var(--motion-ease) both;
}

.stepper__item:nth-child(2) {
    animation-delay: 0.04s;
}

.stepper__item:nth-child(3) {
    animation-delay: 0.08s;
}

.stepper__item:nth-child(4) {
    animation-delay: 0.12s;
}

.stepper__item:hover {
    transform: translateY(-1px);
}

.stepper__item span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(152, 152, 154, 0.16);
    color: var(--color-text-secondary);
}

.stepper__item.is-active {
    border-color: rgba(155, 34, 71, 0.35);
    background: rgba(155, 34, 71, 0.06);
    color: var(--gobmx-guinda);
}

.stepper__item.is-active span {
    background: var(--gobmx-guinda);
    color: #ffffff;
}

.form-sections {
    display: grid;
    gap: 1.25rem;
}

.form-section[hidden],
#next-step-button[hidden],
#submit-button[hidden] {
    display: none !important;
}

.form-section {
    padding: 1.35rem;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.form-section:not([hidden]) {
    animation: softFadeInUp 0.38s var(--motion-ease) both;
}

.form-section__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-section__title {
    margin: 0;
    color: var(--gobmx-guinda);
    font-size: 1.6rem;
}

.general-grid,
.procedure-grid,
.field-grid {
    display: grid;
    gap: 1rem;
}

.general-grid,
.field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field,
.procedure-card {
    position: relative;
}

.field--full,
.procedure-card,
.field-grid .field--full {
    grid-column: 1 / -1;
}

.field__label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text-secondary);
}

.field__required {
    color: var(--gobmx-guinda);
}

.field__control,
.field__textarea,
.field__select {
    width: 100%;
    border: 1px solid rgba(152, 152, 154, 0.35);
    background: #fff;
    border-radius: 14px;
    padding: 0.92rem 1rem;
    font: inherit;
    color: var(--color-text-primary);
    box-shadow: var(--field-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field__textarea {
    min-height: 130px;
    resize: vertical;
}

.field__control:focus,
.field__textarea:focus,
.field__select:focus {
    outline: none;
    border-color: rgba(155, 34, 71, 0.55);
    box-shadow: 0 0 0 4px rgba(155, 34, 71, 0.12);
    transform: translateY(-1px);
}

.field__error {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.8rem;
}

.field__error {
    color: var(--danger);
    min-height: 1.1rem;
}

.field.is-invalid .field__control,
.field.is-invalid .field__textarea,
.field.is-invalid .field__select {
    border-color: rgba(180, 35, 24, 0.5);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1);
}

.field.is-disabled {
    opacity: 0.58;
}

.field.is-disabled .field__control,
.field.is-disabled .field__textarea,
.field.is-disabled .field__select {
    background: #f8fafc;
    box-shadow: none;
}

.procedure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.procedure-card {
    padding: 1.1rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.procedure-card:hover {
    border-color: rgba(155, 34, 71, 0.14);
    box-shadow: 0 12px 28px -28px rgba(15, 23, 42, 0.3);
    transform: translateY(-1px);
}

.procedure-card__title {
    margin: 0 0 0.25rem;
    color: var(--gobmx-guinda);
    font-size: 1.2rem;
}

.procedure-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.procedure-card__grid .field:last-child {
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(152, 152, 154, 0.18);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.page-footer p {
    margin: 0;
    color: var(--ink-soft);
}

.form-actions__buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    min-width: 190px;
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.page-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    overflow: hidden;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.08fr) minmax(220px, 0.92fr) minmax(240px, 1.05fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    padding: 2rem 0 2.5rem;
}

.footer-logo {
    width: min(220px, 100%);
    margin-bottom: 1.6rem;
}

.footer-list {
    display: grid;
    gap: 1.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-list li {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 0.75rem;
    color: #53617a;
    line-height: 1.55;
}

.footer-icon,
.footer-heading__icon {
    color: var(--gobmx-guinda);
    font-weight: 700;
}

.footer-icon svg,
.footer-heading__icon svg,
.footer-link svg {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-heading__icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.footer-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 54px;
    margin-bottom: 1.1rem;
}

.footer-heading__icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(155, 34, 71, 0.04);
    border: 1px solid rgba(155, 34, 71, 0.12);
}

.footer-heading h2,
.footer-gob h3 {
    margin: 0;
    color: #091b36;
    font-family: 'Noto Sans Local', var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
}

.footer-gob p {
    margin: 0 0 1.15rem;
    color: #53617a;
    line-height: 1.55;
}

.footer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    border-bottom: 1px solid rgba(83, 97, 122, 0.16);
    color: #091b36;
    text-decoration: none;
}

.footer-link span {
    color: var(--gobmx-guinda);
    flex: 0 0 auto;
}

.footer-gob h3 {
    margin-top: 1.35rem;
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.footer-social a {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(155, 34, 71, 0.03);
    border: 1px solid rgba(155, 34, 71, 0.12);
    color: var(--gobmx-guinda);
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover,
.footer-link:hover {
    color: var(--gobmx-guinda);
}

.footer-social a:hover {
    background: rgba(155, 34, 71, 0.08);
    border-color: rgba(155, 34, 71, 0.2);
    transform: translateY(-2px);
}

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

@media (max-width: 1100px) {
    .stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .procedure-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-gob {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {

    .general-grid,
    .procedure-grid,
    .procedure-card__grid,
    .field-grid,
    .stepper {
        grid-template-columns: 1fr;
    }

    .page-header__inner,
    .form-card__header,
    .form-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions__buttons,
    .btn {
        width: 100%;
    }

    .btn {
        min-width: 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-gob {
        grid-column: auto;
    }
}

@media (max-width: 560px) {
    .shell {
        width: min(100% - 1rem, 100%);
    }

    .page-main {
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }

    .form-card,
    .form-section,
    .procedure-card {
        border-radius: 18px;
    }

    .brand-lockup {
        gap: 0.65rem;
        width: 100%;
        justify-content: center;
    }

    .brand-lockup__divider {
        height: 32px;
    }

    .brand-lockup__logo--gob,
    .brand-lockup__logo--sener {
        width: min(38vw, 132px);
    }

    .form-card {
        padding: 1rem;
    }

    .form-section,
    .procedure-card {
        padding: 1rem;
    }

    .form-card__header h2 {
        font-size: 1.75rem;
    }

    .form-card__institution {
        font-size: 0.86rem;
    }

    .stepper__item {
        min-height: 52px;
    }

    .footer-grid {
        padding-top: 1.5rem;
    }
}
