/* =========================================================
   RESET Y BASE
   ========================================================= */

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

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f0f2f5;
    color: #2d3748;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #3182ce;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-main {
    flex: 1;
    padding: 2.5rem 0;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    background-color: #1a365d;
    color: #fff;
    padding: 1rem 0;
}

.site-header .container {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.site-header__brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-header__subtitle {
    font-size: 0.85rem;
    opacity: 0.75;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background-color: #e2e8f0;
    padding: 1rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: #718096;
}

/* =========================================================
   CARD
   ========================================================= */

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

.card--centered {
    max-width: 520px;
    margin: 0 auto;
}

.card__header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.card__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a365d;
}

.card__subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
}

.card__description {
    font-size: 0.9rem;
    color: #718096;
    margin-top: 0.5rem;
}

/* =========================================================
   ALERTAS
   ========================================================= */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert__icon {
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert__list {
    list-style: disc;
    padding-left: 1rem;
}

.alert--warning {
    background-color: #fffbeb;
    border: 1px solid #f6ad55;
    color: #744210;
}

.alert--warning .alert__icon {
    background-color: #f6ad55;
    color: #744210;
}

.alert--error {
    background-color: #fff5f5;
    border: 1px solid #fc8181;
    color: #742a2a;
}

.alert--error .alert__icon {
    background-color: #fc8181;
    color: #742a2a;
}

.alert--info {
    background-color: #ebf8ff;
    border: 1px solid #63b3ed;
    color: #2a4365;
}

.alert--info .alert__icon {
    background-color: #63b3ed;
    color: #2a4365;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */

.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
}

.form__required {
    color: #e53e3e;
    margin-left: 2px;
}

.form__input,
.form__select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #2d3748;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

.form__input:focus,
.form__select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.form__input--prefilled {
    background-color: #f7fafc;
    color: #718096;
    cursor: not-allowed;
}

.form__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23718096' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

/* =========================================================
   BOTONES
   ========================================================= */

.form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn--primary {
    background-color: #2b6cb0;
    color: #fff;
}

.btn--primary:hover {
    background-color: #2c5282;
    text-decoration: none;
}

.btn--secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.btn--secondary:hover {
    background-color: #cbd5e0;
    text-decoration: none;
}

.btn--pagar {
    background-color: #276749;
    font-size: 1rem;
    padding: 0.7rem 2rem;
}

.btn--pagar:hover {
    background-color: #22543d;
}

/* Botón ícono (lápiz de editar) */
.btn-icon {
    background: none;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
    color: #4a5568;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: #f7fafc;
    text-decoration: none;
}

/* =========================================================
   RESUMEN (PASO 3)
   ========================================================= */

.resumen__asegurado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.resumen__asegurado-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.resumen__asegurado-icon {
    font-size: 1.75rem;
}

.resumen__asegurado-nombre {
    font-weight: 600;
    color: #2d3748;
}

.resumen__asegurado-dni {
    font-size: 0.85rem;
    color: #718096;
}

.resumen__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .resumen__grid {
        grid-template-columns: 1fr;
    }
}

.resumen__panel {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
}

.resumen__panel-titulo {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.resumen__lista-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 0.35rem 0;
    border-bottom: 1px dashed #e2e8f0;
    color: #4a5568;
}

.resumen__lista-item:last-child {
    border-bottom: none;
}

.resumen__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 2px solid #e2e8f0;
}

.resumen__total-monto {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a365d;
}

.resumen__acciones {
    display: flex;
    justify-content: flex-end;
}

.resumen__acciones form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* =========================================================
   RESULTADO (PASO 5)
   ========================================================= */

.resultado {
    text-align: center;
    padding: 1rem 0;
}

.resultado__icono {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1.25rem;
}

.resultado__titulo {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.resultado__separador {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.25rem 0;
}

.resultado__mensaje {
    font-size: 1rem;
    color: #4a5568;
}

.resultado__descarga {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: underline;
    margin-bottom: 0.5rem;
}

/* Variantes de color por estado */
.resultado--exito .resultado__icono {
    background-color: #c6f6d5;
    color: #276749;
    border: 3px solid #276749;
}

.resultado--exito .resultado__titulo {
    color: #276749;
}

.resultado--exito .resultado__descarga {
    color: #276749;
}

.resultado--pendiente .resultado__icono {
    background-color: #fefcbf;
    color: #744210;
    border: 3px solid #d69e2e;
}

.resultado--pendiente .resultado__titulo {
    color: #744210;
}

.resultado--fallido .resultado__icono {
    background-color: #fff5f5;
    color: #9b2c2c;
    border: 3px solid #fc8181;
}

.resultado--fallido .resultado__titulo {
    color: #9b2c2c;
}
