:root {
    --ficha-azul: #063b7a;
    --ficha-azul-oscuro: #052d5e;
    --ficha-celeste: #0aa7df;
    --ficha-amarillo: #ffe500;
    --ficha-rojo: #e62c3b;
    --ficha-texto: #27364d;
    --ficha-borde: #d9dfe8;
    --ficha-fondo: #f7f8fa;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--ficha-fondo);
    color: var(--ficha-texto);
    font-family: Arial, Helvetica, sans-serif;
}

.ficha-main { flex: 1; }

/* El portal conserva una cabecera sencilla para no competir con el formulario. */
.ficha-header {
    background: #fff;
    border-bottom: 5px solid var(--ficha-amarillo);
    box-shadow: 0 2px 10px rgba(5, 45, 94, .08);
}

.ficha-header-inner {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ficha-brand img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}

.ficha-header-session {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ficha-colegio {
    color: var(--ficha-azul);
    font-size: .9rem;
    font-weight: 700;
}

.btn-cerrar {
    border: 1px solid var(--ficha-azul);
    background: #fff;
    color: var(--ficha-azul);
    padding: 8px 16px;
    font-size: .85rem;
    font-weight: 700;
}

.ficha-access {
    padding: 62px 0 80px;
    background: #fff;
}

.ficha-step-card {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
}

.step-heading {
    margin-bottom: 36px;
    padding-bottom: 22px;
    border-bottom: 1px solid #d9d9d9;
}

.step-heading h1 {
    margin: 0 0 10px;
    color: var(--ficha-azul);
    font-size: 2rem;
    font-weight: 700;
}

.step-heading p {
    margin: 0;
    color: #6d7480;
    font-size: .95rem;
}

.form-label {
    margin-bottom: 8px;
    color: #303a49;
    font-size: .9rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 46px;
    border: 1px solid var(--ficha-borde);
    border-radius: 2px;
    color: var(--ficha-texto);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ficha-celeste);
    box-shadow: 0 0 0 .15rem rgba(10, 167, 223, .12);
}

.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 38px;
    padding-top: 24px;
    border-top: 1px solid #e2e4e8;
}

.btn-ficha-primary,
.btn-ficha-secondary {
    min-width: 120px;
    border: 0;
    border-radius: 2px;
    padding: 11px 22px;
    text-align: center;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 700;
    transition: .2s ease;
}

.btn-ficha-primary {
    background: var(--ficha-azul);
    color: #fff;
}

.btn-ficha-primary:hover { background: var(--ficha-azul-oscuro); }
.btn-ficha-primary:disabled { opacity: .65; }

.btn-ficha-secondary {
    background: #e9ecef;
    color: #49515c;
}

.btn-ficha-secondary:hover {
    background: #dde1e5;
    color: #30363d;
}

.division-card {
    height: 100%;
    border: 1px solid #dce1e7;
    border-top: 4px solid var(--ficha-amarillo);
    padding: 24px;
    background: #fff;
}

.division-card h2 {
    color: var(--ficha-azul);
    font-size: 1.15rem;
    font-weight: 700;
}

.division-year {
    display: inline-block;
    color: var(--ficha-azul);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.division-card .btn-ficha-primary {
    display: block;
    width: 100%;
    margin-top: 18px;
}

.ficha-footer {
    padding: 28px 0;
    background: var(--ficha-azul-oscuro);
    color: rgba(255, 255, 255, .7);
    text-align: center;
}

.ficha-footer-links {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 12px;
}

.ficha-footer a {
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.ficha-footer p {
    margin: 0;
    font-size: .78rem;
}

@media (max-width: 767px) {
    .ficha-header-inner { min-height: 78px; }
    .ficha-brand img { width: 60px; height: 60px; }
    .ficha-colegio { display: none; }
    .ficha-access { padding: 42px 0 60px; }
    .step-heading h1 { font-size: 1.65rem; }
    .step-actions { margin-top: 30px; }
    .btn-ficha-primary, .btn-ficha-secondary { flex: 1; }
    .ficha-footer-links { flex-direction: column; gap: 8px; }
}

/* Acceso de Fichas inspirado en la pantalla oficial de Copa Malta Morena. */
.ficha-login-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: #2e79b8;
    color: #fff;
}

.login-copa {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #2e79b8;
}

.login-copa-container {
    position: relative;
    z-index: 3;
    min-height: 100vh;
}

.login-copa-header {
    min-height: 150px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 44px;
}

.login-copa-logo img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}

.login-copa-nav {
    display: flex;
    align-items: center;
    gap: 52px;
    padding-top: 17px;
    font-size: 1.05rem;
}

.login-copa-nav a,
.login-nav-active {
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.login-copa-nav a:hover {
    opacity: .82;
}

.login-nav-active {
    min-width: 115px;
    padding: 12px 25px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 4px;
    text-align: center;
}

.login-copa-content {
    width: 100%;
    padding-top: 28px;
}

.login-copa-title h1 {
    margin: 0 0 3px;
    color: #fff;
    font-size: 2.25rem;
    font-weight: 700;
}

.login-copa-title p {
    margin: 0;
    color: #fff;
    font-size: 1rem;
}

.login-copa-line {
    width: 100%;
    height: 1px;
    margin: 26px 0 24px;
    background: rgba(255, 255, 255, .75);
}

.login-copa-form {
    width: min(610px, 100%);
}

.login-copa-field {
    margin-bottom: 4px;
}

.login-copa-field label {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-size: 1.03rem;
    font-weight: 700;
}

.login-copa-field input {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 3px;
    padding: 8px 12px;
    background: #fff;
    color: #26384d;
    outline: none;
}

.login-copa-field input:focus {
    border-color: #0b84e9;
    box-shadow: 0 0 0 3px rgba(11, 132, 233, .16);
}

.login-copa-button {
    min-width: 140px;
    margin-top: 22px;
    border: 0;
    border-radius: 26px;
    padding: 13px 27px;
    background: #1088ef;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(0, 66, 130, .2);
}

.login-copa-button:hover {
    background: #087be0;
}

.login-copa-button:disabled {
    opacity: .7;
}

.login-copa-alert {
    width: min(610px, 100%);
    margin-bottom: 18px;
}

/* Las dos capas inferiores imitan el relieve azul de la referencia sin usar imágenes externas. */
.login-copa-montana {
    position: absolute;
    left: -3%;
    width: 106%;
    pointer-events: none;
}

.login-copa-montana-atras {
    z-index: 1;
    bottom: 50px;
    height: 145px;
    background: #1268ad;
    clip-path: polygon(0 68%, 20% 14%, 38% 14%, 58% 57%, 76% 14%, 91% 14%, 100% 68%, 100% 100%, 0 100%);
}

.login-copa-montana-frente {
    z-index: 2;
    bottom: 0;
    height: 132px;
    background: #052b62;
    clip-path: polygon(0 68%, 24% 7%, 37% 7%, 58% 55%, 77% 7%, 88% 7%, 100% 66%, 100% 100%, 0 100%);
}

@media (min-width: 1200px) {
    .login-copa-container {
        max-width: 1220px;
    }
}

@media (max-width: 767px) {
    .login-copa-header {
        min-height: 126px;
        padding-top: 24px;
    }

    .login-copa-logo img {
        width: 64px;
        height: 64px;
    }

    .login-copa-nav {
        gap: 15px;
        padding-top: 10px;
        font-size: .82rem;
    }

    .login-nav-active {
        min-width: auto;
        padding: 8px 12px;
    }

    .login-copa-content {
        padding-top: 16px;
    }

    .login-copa-title h1 {
        font-size: 1.9rem;
    }

    .login-copa-montana-atras {
        bottom: 35px;
        height: 95px;
    }

    .login-copa-montana-frente {
        height: 90px;
    }
}

/* Pantalla posterior al acceso, siguiendo la misma línea visual de Ficha Registro. */
.ficha-registro-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: #2e79b8;
    color: #fff;
}

.registro-copa {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #2e79b8;
}

.registro-copa-container {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    padding-bottom: 185px;
}

.registro-nav-active {
    color: #fff;
    white-space: nowrap;
}

.registro-logout {
    min-width: 115px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 4px;
    padding: 11px 24px;
    background: transparent;
    color: #fff;
    font: inherit;
}

.registro-logout:hover {
    background: rgba(255, 255, 255, .08);
}

.registro-copa-content {
    width: 100%;
    padding-top: 18px;
}

.registro-copa-title h1 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 2.25rem;
    font-weight: 700;
}

.registro-copa-title p {
    margin: 0;
    color: #fff;
    font-size: 1rem;
}

.registro-copa-line {
    width: 100%;
    height: 1px;
    margin: 26px 0 26px;
    background: rgba(255, 255, 255, .75);
}

.registro-alert {
    max-width: 720px;
}

.registro-colegio-grid {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
}

.registro-field-wide {
    grid-column: 1 / -1;
}

.registro-field label {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.registro-field input {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 3px;
    padding: 8px 12px;
    background: #fff;
    color: #26384d;
}

.registro-seccion-titulo {
    width: min(920px, 100%);
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,.7);
}

.registro-seccion-titulo h2 {
    margin: 0 0 3px;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
}

.registro-seccion-titulo p {
    margin: 0;
    color: rgba(255,255,255,.9);
    font-size: .95rem;
}

.registro-divisiones {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.registro-division-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "nombre accion"
        "anio accion";
    align-items: center;
    min-height: 78px;
    padding: 14px 18px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 4px;
    background: rgba(255,255,255,.07);
    color: #fff;
    text-decoration: none;
    transition: .2s ease;
}

.registro-division-card:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
    transform: translateY(-1px);
}

.registro-division-nombre {
    grid-area: nombre;
    font-size: 1.05rem;
    font-weight: 700;
}

.registro-division-anio {
    grid-area: anio;
    opacity: .85;
    font-size: .9rem;
}

.registro-division-accion {
    grid-area: accion;
    margin-left: 16px;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 22px;
    padding: 8px 14px;
    font-size: .78rem;
    font-weight: 700;
}

.registro-cargando,
.registro-vacio {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: #fff;
}

.registro-copa-montana {
    position: absolute;
    left: -3%;
    width: 106%;
    pointer-events: none;
}

.registro-copa-montana-atras {
    z-index: 1;
    bottom: 50px;
    height: 145px;
    background: #1268ad;
    clip-path: polygon(0 68%, 20% 14%, 38% 14%, 58% 57%, 76% 14%, 91% 14%, 100% 68%, 100% 100%, 0 100%);
}

.registro-copa-montana-frente {
    z-index: 2;
    bottom: 0;
    height: 132px;
    background: #052b62;
    clip-path: polygon(0 68%, 24% 7%, 37% 7%, 58% 55%, 77% 7%, 88% 7%, 100% 66%, 100% 100%, 0 100%);
}

/* Conserva la proporción real del logo proporcionado. */
.login-copa-logo img {
    width: 84px;
    height: auto;
    max-height: none;
    object-fit: contain;
}

@media (min-width: 1200px) {
    .registro-copa-container { max-width: 1220px; }
}

@media (max-width: 767px) {
    .registro-copa-container { padding-bottom: 135px; }
    .registro-colegio-grid,
    .registro-divisiones { grid-template-columns: 1fr; }
    .registro-field-wide { grid-column: auto; }
    .registro-copa-title h1 { font-size: 1.9rem; }
    .registro-logout { min-width: auto; padding: 8px 12px; }
    .registro-copa-montana-atras { bottom: 35px; height: 95px; }
    .registro-copa-montana-frente { height: 90px; }
}

/* Datos de Colegio y Representante: distribución basada en la ficha de referencia. */
.registro-datos {
    min-height: 100vh;
    background: #2e79b8;
}

.registro-datos .registro-copa-container {
    min-height: auto;
    padding-bottom: 0;
}

.registro-header {
    min-height: 118px;
    padding-top: 22px;
}

/* El logo siempre conserva la proporción del archivo original. */
.login-copa-logo,
.ficha-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-copa-logo img,
.ficha-brand img {
    width: 72px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.registro-form-wrap {
    width: 100%;
    padding-bottom: 54px;
}

.registro-tabs {
    display: flex;
    width: 100%;
    min-height: 38px;
    margin-bottom: 20px;
    background: #dff1fb;
}

.registro-tab {
    border: 0;
    padding: 10px 18px;
    background: transparent;
    color: #2773b4;
    font-size: .95rem;
    text-align: left;
}

.registro-tab.active {
    background: #fff;
    color: #31445b;
}

.datos-doble-columna {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.datos-bloque h1 {
    margin: 0;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
}

.datos-separador {
    width: 100%;
    height: 1px;
    margin: 16px 0 18px;
    background: rgba(255, 255, 255, .82);
}

.datos-bloque .registro-field {
    margin-bottom: 4px;
}

.datos-bloque .registro-field label {
    margin-bottom: 3px;
    font-size: .93rem;
}

.datos-bloque .registro-field input,
.datos-bloque .registro-field textarea,
.division-selector select {
    width: 100%;
    min-height: 35px;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 3px;
    padding: 7px 10px;
    background: #fff;
    color: #34445a;
    font-size: .92rem;
    outline: none;
}

.datos-bloque .registro-field textarea {
    resize: vertical;
}

.datos-bloque .registro-field small {
    display: block;
    margin-top: 2px;
    color: #fff;
    font-size: .8rem;
}

.archivo-simulacion {
    min-height: 35px;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 3px;
    background: #fff;
    color: #6b7280;
    font-size: .85rem;
}

.archivo-carga {
    cursor: pointer;
}

.archivo-carga::file-selector-button {
    margin: -7px 12px -7px -10px;
    min-height: 35px;
    padding: 7px 14px;
    border: 0;
    border-right: 1px solid rgba(0, 0, 0, .14);
    background: #eef3f8;
    color: #24466f;
    font-weight: 700;
    cursor: pointer;
}

.preview-ficha {
    display: block;
    width: 100px;
    height: 130px;
    margin-top: 18px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 3px;
    background: #fff;
    object-fit: contain;
}

.sin-imagen {
    margin: 10px 0 0;
    color: rgba(255,255,255,.82);
    font-size: .82rem;
}

.registro-continuar {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    margin-top: 34px;
}

.division-selector {
    width: min(420px, 100%);
}

.division-selector label {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
}

.registro-continuar .btn-siguiente,
.registro-continuar .btn-guardar-datos {
    min-width: 104px;
    min-height: 46px;
    border: 0;
    border-radius: 24px;
    padding: 10px 22px;
    background: #f4c400;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 5px 10px rgba(0,0,0,.12);
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.registro-continuar .btn-siguiente:hover:not(:disabled),
.registro-continuar .btn-guardar-datos:hover:not(:disabled) {
    background: #ddb200;
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(0,0,0,.14);
}

.registro-continuar .btn-siguiente:disabled,
.registro-continuar .btn-guardar-datos:disabled {
    background: #b9bec4;
    color: #ffffff;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.proteccion-datos {
    max-width: 1060px;
    margin-top: 52px;
    color: #fff;
    font-size: .89rem;
    line-height: 1.7;
}

.proteccion-datos p {
    margin: 20px 0 0;
}

.registro-footer {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    background: #052b62;
    color: #fff;
}

.registro-footer-shape {
    position: absolute;
    top: -28px;
    left: -2%;
    width: 104%;
    height: 52px;
    background: #052b62;
    clip-path: polygon(0 0, 54% 100%, 100% 0, 100% 100%, 0 100%);
}

.registro-footer-inner {
    min-height: 230px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 38px;
}

.registro-footer-inner p {
    margin: 0;
    font-size: .83rem;
}

.registro-footer-inner div {
    display: flex;
    gap: 42px;
}

.registro-footer a {
    color: #ffe500;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
}

@media (max-width: 767px) {
    .registro-header {
        min-height: 105px;
        padding-top: 18px;
    }

    .login-copa-logo img,
    .ficha-brand img {
        width: 60px;
        height: auto;
    }

    .registro-tabs {
        overflow-x: auto;
    }

    .registro-tab {
        white-space: nowrap;
        font-size: .82rem;
    }

    .datos-doble-columna {
        grid-template-columns: 1fr;
    }

    .registro-continuar {
        align-items: stretch;
        flex-direction: column;
    }

    .division-selector,
    .btn-siguiente,
    .btn-guardar-datos {
        width: 100%;
    }

    .registro-footer-inner {
        min-height: 210px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-end;
    }

    .registro-footer-inner div {
        flex-direction: column;
        gap: 10px;
    }
}

/* Formulario del cuerpo técnico dentro de la ficha. */
.staff-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 20px; }
.staff-modal.d-none { display: none !important; }
.staff-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 31, 76, .72); }
.staff-modal-card { position: relative; width: min(620px, 100%); background: #fff; color: #17305c; border-radius: 4px; box-shadow: 0 18px 55px rgba(0,0,0,.25); overflow: hidden; }
.staff-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid #dce2ea; }
.staff-modal-header h2 { margin: 0; font-size: 21px; }
.staff-modal-cerrar { border: 0; background: transparent; font-size: 30px; line-height: 1; color: #17305c; }
#staffForm { padding: 22px; }
.staff-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.staff-form-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.staff-form-grid input { width: 100%; border: 1px solid #cfd8e3; border-radius: 3px; padding: 10px 12px; font: inherit; }
.staff-form-grid small { color: #6d7785; font-weight: 400; }
.staff-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.staff-btn-secundario, .staff-btn-guardar { border: 0; border-radius: 22px; padding: 10px 22px; font-weight: 700; }
.staff-btn-secundario { background: #e6e9ed; color: #17305c; }
.staff-btn-guardar { background: #1db64b; color: #fff; }
.staff-modal-mensaje { margin-top: 16px; padding: 10px 12px; background: #fde8e8; color: #a52020; border-radius: 3px; }
@media (max-width: 640px) { .staff-form-grid { grid-template-columns: 1fr; } }

/* ==========================================================
   Ficha de Equipo
   Mantiene la distribución de la referencia: compromiso a la
   izquierda, cuerpo técnico a la derecha y jugadores debajo.
   ========================================================== */
.registro-equipo-page {
    min-height: 100vh;
    background: #2c79b6;
    color: #fff;
}

.registro-equipo-page .registro-form-wrap {
    padding-bottom: 58px;
}

.ficha-equipo-wrap {
    width: 100%;
}

.ficha-equipo-consulta {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 48px;
}

.ficha-equipo-consulta label {
    width: 100%;
    margin: 0;
    color: #fff;
    font-size: .92rem;
    font-weight: 700;
}

.ficha-equipo-consulta select {
    width: min(310px, 100%);
    min-height: 38px;
    border: 1px solid rgba(0, 0, 0, .16);
    border-radius: 3px;
    padding: 7px 10px;
    background: #fff;
    color: #27364d;
    font-size: .9rem;
}

.ficha-btn-consultar {
    min-width: 112px;
    margin: 0;
    padding: 10px 20px;
    border-radius: 24px;
}

.ficha-equipo-superior {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(460px, 1.1fr);
    gap: 70px;
    align-items: start;
}

.ficha-compromiso-col {
    padding-top: 16px;
}

.btn-compromiso {
    min-width: 210px;
    border: 0;
    border-radius: 23px;
    padding: 11px 20px;
    background: #8a8a8a;
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .13);
}

.equipo-resumen {
    margin: 18px 0 0;
    color: #fff;
    font-size: .9rem;
}

/* Las dos tarjetas del cuerpo técnico conservan el mismo tamaño y pie. */
.ficha-staff-panel {
    padding: 18px 18px 16px;
    background: rgba(255, 255, 255, .08);
}

.ficha-staff-panel h2 {
    margin: 0 0 18px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.ficha-staff-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.staff-card {
    overflow: hidden;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 3px;
    background: #f5f6f8;
}

.staff-foto-wrap {
    position: relative;
    height: 275px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f4f5f7;
    color: #a8afb8;
}

.staff-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-sin-foto {
    color: #aeb4bc;
    font-size: .82rem;
}

.staff-editar {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -1px);
    min-width: 76px;
    border: 0;
    border-radius: 0 0 20px 20px;
    padding: 9px 16px;
    background: #1db64b;
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    box-shadow: 0 3px 7px rgba(0, 0, 0, .13);
}

.staff-editar:hover {
    background: #17a742;
}

.staff-pie {
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #747474;
    color: #fff;
    text-align: center;
}

.staff-pie strong {
    margin-bottom: 3px;
    font-size: .82rem;
}

.staff-pie span {
    font-size: .78rem;
}

/* El listado de jugadores se mantiene debajo de las dos columnas principales. */
.ficha-jugadores-seccion {
    margin-top: 48px;
}

.ficha-jugadores-seccion h2 {
    margin: 0 0 18px;
    color: #fff;
    font-size: .95rem;
    font-weight: 400;
}

.ficha-jugadores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 220px));
    gap: 24px;
}

.jugador-ficha-card {
    overflow: hidden;
    border-radius: 3px;
    background: #f3f5f8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
}

.jugador-foto-wrap {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #edf2f7;
    color: #687483;
    font-size: .84rem;
}

.jugador-foto-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jugador-ficha-pie {
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: #747474;
    color: #fff;
    text-align: center;
}

.jugador-ficha-pie strong {
    font-size: .8rem;
}

.jugador-ficha-pie span {
    margin-top: 2px;
    font-size: .77rem;
}

.ficha-vacio {
    margin-top: 22px;
    color: rgba(255, 255, 255, .9);
    font-size: .9rem;
}

.registro-equipo-page .registro-alert {
    margin-top: 18px;
}

@media (max-width: 900px) {
    .ficha-equipo-superior {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .ficha-staff-panel {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .ficha-equipo-consulta {
        align-items: stretch;
        flex-direction: column;
    }

    .ficha-equipo-consulta select,
    .ficha-btn-consultar {
        width: 100%;
    }

    .ficha-staff-grid {
        grid-template-columns: 1fr;
    }

    .staff-foto-wrap {
        height: 250px;
    }

    .ficha-jugadores-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Modal de Entrenador / Asistente
   Replica la ficha de referencia y se adapta a pantallas pequeñas.
   ========================================================== */
.staff-modal {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px 16px;
}

.staff-modal-card {
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 2px;
    color: #222;
}

.staff-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    justify-content: center;
    min-height: 82px;
    padding: 20px 56px;
    background: #fff;
}

.staff-modal-header h2 {
    color: #2f3142;
    font-size: 1.65rem;
    font-weight: 700;
    text-align: center;
}

.staff-modal-cerrar {
    position: absolute;
    top: 8px;
    right: 12px;
    color: #b6b6b6;
    font-size: 22px;
    cursor: pointer;
}

#staffForm {
    padding: 24px 38px 34px;
}

.staff-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.staff-form-grid label {
    gap: 7px;
    color: #202020;
    font-size: .92rem;
    font-weight: 700;
}

.staff-form-grid input {
    min-height: 46px;
    border: 1px solid #d8d8d8;
    border-radius: 3px;
    padding: 9px 12px;
    background: #fff;
    color: #333;
    font-size: .95rem;
}

.staff-form-grid input:focus {
    border-color: #2e79b8;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(46, 121, 184, .12);
}

.staff-form-grid input[type="file"] {
    min-height: 48px;
    padding: 8px 10px;
}

.staff-form-grid small {
    margin-top: -2px;
    color: #777;
    font-size: .76rem;
}

.staff-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.staff-btn-secundario,
.staff-btn-guardar {
    min-height: 50px;
    border-radius: 3px;
    padding: 12px 18px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.staff-btn-secundario {
    background: #eceff2;
}

.staff-btn-guardar {
    background: #20ad45;
}

/* En tablet se reduce el espacio sin perder la forma del formulario. */
@media (max-width: 768px) {
    .staff-modal {
        align-items: flex-start;
        padding: 16px 12px;
    }

    .staff-modal-card {
        max-height: calc(100vh - 32px);
    }

    .staff-modal-header {
        min-height: 72px;
        padding: 18px 46px;
    }

    .staff-modal-header h2 {
        font-size: 1.45rem;
    }

    #staffForm {
        padding: 22px 24px 28px;
    }
}

/* En celular el modal ocupa casi toda la pantalla y evita desplazamiento horizontal. */
@media (max-width: 480px) {
    .staff-modal {
        padding: 0;
    }

    .staff-modal-card {
        width: 100%;
        min-height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .staff-modal-header {
        min-height: 66px;
        padding: 16px 42px;
    }

    .staff-modal-header h2 {
        font-size: 1.3rem;
    }

    #staffForm {
        padding: 18px 16px 28px;
    }

    .staff-form-grid {
        gap: 14px;
    }

    .staff-form-grid label {
        font-size: .88rem;
    }

    .staff-form-grid input {
        min-height: 44px;
        font-size: 16px;
    }

    .staff-modal-actions {
        grid-template-columns: 1fr;
        position: sticky;
        bottom: -28px;
        padding-top: 10px;
        background: #fff;
    }

    .staff-btn-guardar {
        order: -1;
    }
}

/* Modal informativo de compromiso: replica la lectura amplia de la ficha de referencia. */
.compromiso-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.compromiso-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 31, 58, 0.78);
}

.compromiso-modal-card {
    position: relative;
    width: min(775px, 92vw);
    max-height: 88vh;
    overflow: hidden;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.compromiso-modal-header {
    min-height: 38px;
    border-bottom: 1px solid #e7e7e7;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 14px;
}

.compromiso-modal-cerrar {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #b8b8b8;
    cursor: pointer;
}

.compromiso-modal-contenido {
    padding: 72px 56px 64px;
    max-height: calc(88vh - 39px);
    overflow-y: auto;
    color: #171717;
    font-size: 20px;
    line-height: 1.4;
}

.compromiso-modal-contenido p {
    margin: 0 0 30px;
}

.compromiso-modal-contenido p:last-child {
    margin-bottom: 0;
}

/* En celular el modal aprovecha el ancho y mantiene una lectura cómoda. */
@media (max-width: 576px) {
    .compromiso-modal {
        padding: 10px;
        align-items: flex-start;
    }

    .compromiso-modal-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        margin-top: 0;
    }

    .compromiso-modal-contenido {
        padding: 34px 24px 40px;
        max-height: calc(100vh - 59px);
        font-size: 16px;
        line-height: 1.5;
    }

    .compromiso-modal-contenido p {
        margin-bottom: 24px;
    }
}

/* ==========================================================
   Modal Agregar Jugador
   Formulario dividido por secciones para facilitar la lectura.
   ========================================================== */
.ficha-jugadores-encabezado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ficha-jugadores-encabezado h2 {
    margin: 0;
}

.btn-agregar-jugador {
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    background: #20ad45;
    color: #fff;
    box-shadow: 0 7px 18px rgba(32, 173, 69, .18);
    font-size: .84rem;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn-agregar-jugador:hover {
    transform: translateY(-1px);
    background: #169d3b;
    box-shadow: 0 10px 22px rgba(32, 173, 69, .24);
}

.btn-agregar-jugador:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
    box-shadow: none;
}

.jugador-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.jugador-modal.d-none {
    display: none !important;
}

.jugador-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 28, 44, .72);
    backdrop-filter: blur(3px);
}

.jugador-modal-card {
    position: relative;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 18px;
    background: #f6f8fb;
    color: #18202a;
    box-shadow: 0 26px 80px rgba(0, 0, 0, .34);
    scrollbar-width: thin;
    scrollbar-color: #bdc7d1 transparent;
}

.jugador-modal-card::-webkit-scrollbar {
    width: 9px;
}

.jugador-modal-card::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #bdc7d1;
    background-clip: padding-box;
}

.jugador-modal-header {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 118px;
    padding: 24px 76px 22px 30px;
    border-bottom: 1px solid #e6eaf0;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(8px);
}

.jugador-modal-titulo {
    min-width: 0;
}

.jugador-modal-etiqueta {
    display: inline-block;
    margin-bottom: 5px;
    color: #16883a;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.jugador-modal-header h2 {
    margin: 0;
    color: #263247;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.jugador-modal-header p {
    margin: 6px 0 0;
    color: #748092;
    font-size: .86rem;
    line-height: 1.45;
}

.jugador-modal-cerrar {
    position: absolute;
    top: 22px;
    right: 24px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #e1e6ec;
    border-radius: 50%;
    background: #fff;
    color: #8b96a5;
    box-shadow: 0 4px 14px rgba(23, 36, 53, .08);
    font-size: 23px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.jugador-modal-cerrar:hover {
    transform: rotate(4deg);
    background: #f2f4f7;
    color: #263247;
}

#jugadorForm {
    padding: 24px;
}

.jugador-form-seccion {
    margin-bottom: 18px;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(28, 45, 67, .045);
}

.jugador-form-seccion-final {
    margin-bottom: 0;
}

.jugador-seccion-titulo {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 20px;
}

.jugador-seccion-numero {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: #eaf8ee;
    color: #17883a;
    font-size: .74rem;
    font-weight: 800;
}

.jugador-seccion-titulo h3 {
    margin: 0;
    color: #2a3446;
    font-size: 1rem;
    font-weight: 800;
}

.jugador-seccion-titulo p {
    margin: 3px 0 0;
    color: #8490a0;
    font-size: .76rem;
}

.jugador-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px 20px;
}

.jugador-form-grid label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    color: #394458;
    font-size: .83rem;
    font-weight: 700;
}

.jugador-form-grid label > span b {
    color: #1ca246;
    font-weight: 800;
}

.jugador-form-grid input,
.jugador-form-grid select,
.jugador-form-grid textarea {
    width: 100%;
    border: 1px solid #dbe1e8;
    border-radius: 9px;
    padding: 11px 13px;
    background: #fbfcfd;
    color: #263247;
    font: inherit;
    font-size: .9rem;
    font-weight: 400;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.jugador-form-grid input,
.jugador-form-grid select {
    min-height: 47px;
}

.jugador-form-grid textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.5;
}

.jugador-form-grid input::placeholder,
.jugador-form-grid textarea::placeholder {
    color: #aab2bd;
}

.jugador-form-grid input:hover,
.jugador-form-grid select:hover,
.jugador-form-grid textarea:hover {
    border-color: #c9d1da;
    background: #fff;
}

.jugador-form-grid input:focus,
.jugador-form-grid select:focus,
.jugador-form-grid textarea:focus {
    border-color: #42a660;
    outline: 0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(32, 173, 69, .10);
}

.jugador-form-grid input[type="file"] {
    min-height: 52px;
    padding: 7px;
    background: #f8fafb;
    color: #6d7887;
    cursor: pointer;
}

.jugador-form-grid input[type="file"]::file-selector-button {
    margin-right: 10px;
    border: 0;
    border-radius: 7px;
    padding: 9px 13px;
    background: #e9eef4;
    color: #344055;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease;
}

.jugador-form-grid input[type="file"]::file-selector-button:hover {
    background: #dfe6ed;
}

.jugador-form-grid small {
    margin-top: -2px;
    color: #929cab;
    font-size: .69rem;
    font-weight: 400;
    line-height: 1.35;
}

.jugador-campo-ancho {
    grid-column: 1 / -1;
}

.jugador-modal-mensaje {
    margin: 18px 0 0;
    border: 1px solid #cfe2ff;
    border-radius: 9px;
    padding: 11px 13px;
    background: #edf5ff;
    color: #365e86;
    font-size: .82rem;
}

.jugador-form-acciones {
    position: sticky;
    bottom: -24px;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 22px -24px -24px;
    border-top: 1px solid #e4e9ef;
    padding: 16px 24px;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(7px);
}

.jugador-btn-cancelar,
.jugador-btn-guardar {
    min-height: 44px;
    border-radius: 9px;
    padding: 10px 21px;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.jugador-btn-cancelar {
    border: 1px solid #d9e0e7;
    background: #fff;
    color: #657183;
}

.jugador-btn-cancelar:hover {
    background: #f3f5f7;
    color: #334055;
}

.jugador-btn-guardar {
    min-width: 158px;
    border: 0;
    background: #20ad45;
    color: #fff;
    box-shadow: 0 7px 16px rgba(32, 173, 69, .18);
}

.jugador-btn-guardar:hover {
    transform: translateY(-1px);
    background: #169d3b;
    box-shadow: 0 9px 20px rgba(32, 173, 69, .24);
}

@media (max-width: 760px) {
    .jugador-modal {
        align-items: flex-start;
        padding: 12px;
    }

    .jugador-modal-card {
        max-height: calc(100dvh - 24px);
        border-radius: 14px;
    }

    .jugador-modal-header {
        min-height: 100px;
        padding: 20px 60px 18px 20px;
    }

    .jugador-modal-header h2 {
        font-size: 1.45rem;
    }

    .jugador-modal-header p {
        font-size: .78rem;
    }

    .jugador-modal-cerrar {
        top: 18px;
        right: 18px;
        width: 34px;
        height: 34px;
    }

    #jugadorForm {
        padding: 16px;
    }

    .jugador-form-seccion {
        padding: 18px;
    }

    .jugador-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .jugador-campo-ancho {
        grid-column: auto;
    }

    .jugador-form-acciones {
        bottom: -16px;
        margin: 18px -16px -16px;
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .ficha-jugadores-encabezado {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-agregar-jugador {
        width: 100%;
    }

    .jugador-modal {
        padding: 0;
    }

    .jugador-modal-card {
        width: 100%;
        min-height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .jugador-modal-header {
        min-height: 92px;
        padding: 17px 52px 16px 16px;
    }

    .jugador-modal-etiqueta {
        font-size: .66rem;
    }

    .jugador-modal-header h2 {
        font-size: 1.28rem;
    }

    .jugador-modal-header p {
        display: none;
    }

    .jugador-modal-cerrar {
        top: 16px;
        right: 14px;
    }

    #jugadorForm {
        padding: 12px;
    }

    .jugador-form-seccion {
        margin-bottom: 12px;
        border-radius: 11px;
        padding: 15px;
    }

    .jugador-seccion-titulo {
        gap: 10px;
        margin-bottom: 16px;
    }

    .jugador-seccion-numero {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .jugador-seccion-titulo h3 {
        font-size: .94rem;
    }

    .jugador-seccion-titulo p {
        font-size: .7rem;
    }

    .jugador-form-grid input,
    .jugador-form-grid select,
    .jugador-form-grid textarea {
        font-size: 16px;
    }

    .jugador-form-acciones {
        bottom: -12px;
        display: grid;
        grid-template-columns: 1fr 1.25fr;
        margin: 16px -12px -12px;
        padding: 12px;
    }

    .jugador-btn-cancelar,
    .jugador-btn-guardar {
        min-width: 0;
        min-height: 46px;
        padding: 9px 10px;
    }
}

/* ==========================================================
   Ajuste visual de la ficha de jugador
   Los archivos se muestran como tarjetas de carga para que la
   ficha tenga una identidad más cercana al portal deportivo.
   ========================================================== */
.jugador-form-seccion {
    position: relative;
    overflow: hidden;
    border-color: #dfe5eb;
    box-shadow: 0 8px 24px rgba(25, 43, 67, .055);
}

.jugador-form-seccion::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #1fa846 0%, #1476b8 100%);
}

.jugador-seccion-numero {
    border: 1px solid #d8ede0;
    background: #f2faf4;
    box-shadow: inset 0 0 0 3px #fff;
}

.jugador-form-grid input:not([type="file"]),
.jugador-form-grid textarea {
    border-radius: 7px;
    border-color: #d8dfe7;
    background: #fff;
}

.jugador-form-grid-archivos {
    gap: 16px;
}

.jugador-form-grid label.jugador-archivo {
    gap: 13px;
    min-height: 178px;
    border: 1px dashed #b9c5d1;
    border-radius: 12px;
    padding: 17px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: none;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.jugador-form-grid label.jugador-archivo:hover {
    transform: translateY(-1px);
    border-color: #6fa885;
    background: #fff;
    box-shadow: 0 8px 20px rgba(31, 78, 52, .08);
}

.jugador-archivo-cabecera {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.jugador-archivo-cabecera > div {
    min-width: 0;
}

.jugador-archivo-cabecera strong {
    display: block;
    margin-bottom: 3px;
    color: #273448;
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.35;
}

.jugador-archivo-cabecera strong b {
    color: #1ca246;
}

.jugador-archivo-cabecera > div > span {
    display: block;
    color: #84909e;
    font-size: .7rem;
    font-weight: 400;
    line-height: 1.4;
}

.jugador-archivo-marca {
    display: grid;
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    place-items: center;
    border-radius: 10px;
    background: #173d63;
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .06em;
}

.jugador-archivo-foto .jugador-archivo-marca {
    background: #1c9c43;
}

.jugador-form-grid label.jugador-archivo input[type="file"] {
    min-height: 46px;
    margin: 0;
    border: 1px solid #e0e5ea;
    border-radius: 8px;
    padding: 5px;
    background: #fff;
    font-size: .74rem;
}

.jugador-form-grid label.jugador-archivo input[type="file"]::file-selector-button {
    min-height: 34px;
    margin-right: 9px;
    border: 1px solid #d9e0e6;
    border-radius: 6px;
    padding: 7px 11px;
    background: #f1f4f7;
    color: #334258;
    font-size: .72rem;
    font-weight: 800;
}

.jugador-archivo-reglas {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
}

.jugador-archivo-reglas span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border: 1px solid #e0e6eb;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f7f9fb;
    color: #667486;
    font-size: .64rem;
    font-weight: 700;
    line-height: 1.2;
}

.jugador-archivo-foto .jugador-archivo-reglas span:first-child {
    border-color: #d9eddf;
    background: #f1faf4;
    color: #277341;
}

.jugador-archivo-documento .jugador-archivo-reglas span:first-child {
    border-color: #dce7f2;
    background: #f1f6fb;
    color: #355f83;
}

.jugador-modal-header {
    border-top: 5px solid #1fa846;
}

.jugador-modal-etiqueta {
    position: relative;
    padding-left: 15px;
}

.jugador-modal-etiqueta::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1fa846;
    transform: translateY(-50%);
}

@media (max-width: 760px) {
    .jugador-form-grid label.jugador-archivo {
        min-height: 0;
        padding: 15px;
    }

    .jugador-archivo-reglas {
        gap: 5px;
    }

    .jugador-archivo-reglas span {
        font-size: .61rem;
    }
}

/* Formulario de jugador: estilo simple para mantener la misma línea visual del portal. */
.jugador-modal-backdrop {
    background: rgba(0, 0, 0, .55);
    backdrop-filter: none;
}

.jugador-modal-card {
    width: min(860px, 100%);
    border: 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
}

.jugador-modal-header {
    min-height: auto;
    padding: 20px 58px 16px 24px;
    border-top: 0;
    border-bottom: 2px solid #27a844;
    background: #fff;
    backdrop-filter: none;
}

.jugador-modal-header h2 {
    margin: 0;
    color: #2e343b;
    font-size: 1.35rem;
    font-weight: 700;
}

.jugador-modal-titulo,
.jugador-modal-etiqueta,
.jugador-modal-header p {
    display: none;
}

.jugador-modal-cerrar {
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    color: #777;
}

.jugador-modal-cerrar:hover {
    transform: none;
    background: #f2f2f2;
    color: #333;
}

#jugadorForm {
    padding: 22px 24px 0;
}

.jugador-form-seccion,
.jugador-form-seccion-final {
    position: static;
    overflow: visible;
    margin: 0 0 24px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.jugador-form-seccion::before {
    display: none;
}

.jugador-seccion-simple {
    margin: 0 0 14px;
    border-bottom: 1px solid #dedede;
    padding-bottom: 7px;
    color: #424242;
    font-size: .95rem;
    font-weight: 700;
}

.jugador-form-grid {
    gap: 15px 18px;
}

.jugador-form-grid label {
    gap: 6px;
    color: #444;
    font-size: .8rem;
    font-weight: 600;
}

.jugador-form-grid input,
.jugador-form-grid select,
.jugador-form-grid textarea {
    min-height: 42px;
    border: 1px solid #cfd4d8;
    border-radius: 4px;
    padding: 9px 10px;
    background: #fff;
    color: #333;
    font-size: .86rem;
}

.jugador-form-grid textarea {
    min-height: 80px;
}

.jugador-form-grid input:hover,
.jugador-form-grid select:hover,
.jugador-form-grid textarea:hover {
    border-color: #b9bec3;
}

.jugador-form-grid input:focus,
.jugador-form-grid select:focus,
.jugador-form-grid textarea:focus {
    border-color: #2ca648;
    box-shadow: 0 0 0 2px rgba(44, 166, 72, .08);
}

.jugador-form-grid-archivos {
    gap: 16px 18px;
}

.jugador-form-grid label.jugador-archivo-simple {
    display: flex;
    min-height: auto;
    gap: 6px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.jugador-form-grid label.jugador-archivo-simple:hover {
    transform: none;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.jugador-form-grid label.jugador-archivo-simple input[type="file"] {
    min-height: 42px;
    margin: 0;
    border: 1px solid #cfd4d8;
    border-radius: 4px;
    padding: 5px;
    background: #fff;
    color: #555;
    font-size: .76rem;
}

.jugador-form-grid label.jugador-archivo-simple input[type="file"]::file-selector-button {
    min-height: 30px;
    margin-right: 8px;
    border: 0;
    border-radius: 3px;
    padding: 6px 10px;
    background: #e9ecef;
    color: #444;
    font-size: .73rem;
    font-weight: 600;
}

.jugador-form-grid label.jugador-archivo-simple small {
    margin: 0;
    color: #777;
    font-size: .67rem;
    line-height: 1.35;
}

.jugador-form-acciones {
    position: static;
    margin: 6px -24px 0;
    border-top: 1px solid #e4e4e4;
    padding: 14px 24px;
    background: #f8f8f8;
    backdrop-filter: none;
}

.jugador-btn-cancelar,
.jugador-btn-guardar {
    min-height: 40px;
    border-radius: 4px;
    padding: 9px 18px;
    font-size: .8rem;
    font-weight: 700;
    box-shadow: none;
}

.jugador-btn-guardar {
    min-width: 130px;
    background: #29a846;
}

.jugador-btn-guardar:hover {
    transform: none;
    background: #218c3a;
}

@media (max-width: 760px) {
    .jugador-modal {
        padding: 12px;
    }

    .jugador-modal-card {
        max-height: calc(100vh - 24px);
        border-radius: 6px;
    }

    .jugador-modal-header {
        padding: 17px 52px 14px 17px;
    }

    #jugadorForm {
        padding: 18px 17px 0;
    }

    .jugador-form-grid {
        grid-template-columns: 1fr;
    }

    .jugador-form-acciones {
        grid-template-columns: 1fr 1fr;
        margin: 4px -17px 0;
        padding: 12px 17px;
    }
}

/* Evita envíos dobles mientras se registra un jugador. */
.jugador-btn-guardar:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* Las tarjetas de jugadores también funcionan como acceso a edición. */
.jugador-ficha-card {
    width: 100%;
    border: 0;
    padding: 0;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
}

.jugador-ficha-card:hover,
.jugador-ficha-card:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .7);
    outline-offset: 2px;
}

.jugador-ficha-editar {
    width: fit-content;
    margin-top: 9px;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 6px;
    padding: 6px 11px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: .7rem;
    font-weight: 750;
    line-height: 1;
    opacity: 1;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.jugador-ficha-card:hover .jugador-ficha-editar,
.jugador-ficha-card:focus-visible .jugador-ficha-editar {
    background: #fff;
    color: #17305c;
    transform: translateY(-1px);
}

/* Acciones de edición del jugador. */
.jugador-form-acciones {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.jugador-form-acciones-derecha {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* La acción secundaria queda visible sin competir con Guardar. */
.jugador-btn-desactivar {
    min-height: 42px;
    border: 1px solid #d9a0a0;
    border-radius: 7px;
    padding: 9px 15px;
    background: #fff5f5;
    color: #9a3535;
    font-size: .79rem;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 3px 9px rgba(154, 53, 53, .08);
    transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.jugador-btn-desactivar::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: #bf5555;
    vertical-align: 1px;
}

.jugador-btn-desactivar:hover,
.jugador-btn-desactivar:focus-visible {
    border-color: #b94b4b;
    background: #b94b4b;
    color: #fff;
    box-shadow: 0 6px 14px rgba(154, 53, 53, .18);
    transform: translateY(-1px);
    outline: 0;
}

.jugador-btn-desactivar:hover::before,
.jugador-btn-desactivar:focus-visible::before {
    background: #fff;
}

/* Confirmación de cambio de estado. Se mantiene simple y coherente con la ficha. */
.jugador-confirmacion {
    position: fixed;
    inset: 0;
    z-index: 2147483647 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    isolation: isolate;
}

body.confirmacion-jugador-abierta {
    overflow: hidden;
}

.jugador-modal.tiene-confirmacion {
    pointer-events: none;
}

.jugador-confirmacion.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.jugador-confirmacion-fondo {
    position: absolute;
    inset: 0;
    background: rgba(18, 37, 53, .55);
    backdrop-filter: blur(2px);
}

.jugador-confirmacion-card {
    position: relative;
    width: min(470px, 100%);
    overflow: hidden;
    border: 1px solid #e5e8eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(20, 39, 55, .18);
    transform: translateY(10px) scale(.985);
    transition: transform .18s ease;
}

.jugador-confirmacion.is-visible .jugador-confirmacion-card {
    transform: translateY(0) scale(1);
}

.jugador-confirmacion-cabecera {
    display: grid;
    grid-template-columns: 4px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #edf0f2;
}

.jugador-confirmacion-marca {
    width: 4px;
    height: 38px;
    border-radius: 4px;
    background: #b64a4a;
}

.jugador-confirmacion-cabecera small {
    display: block;
    margin-bottom: 2px;
    color: #8a9299;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.jugador-confirmacion-card h3 {
    margin: 0;
    color: #273746;
    font-size: 1.12rem;
    font-weight: 700;
}

.jugador-confirmacion-cerrar {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9aa0a5;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.jugador-confirmacion-cerrar:hover {
    background: #f3f5f6;
    color: #505b64;
}

.jugador-confirmacion-contenido {
    padding: 20px 22px 4px;
}

.jugador-confirmacion-pregunta {
    margin: 0 0 8px;
    color: #354653;
    font-size: .93rem;
    line-height: 1.5;
}

.jugador-confirmacion-pregunta strong {
    color: #1f3444;
    font-weight: 700;
}

.jugador-confirmacion-detalle {
    margin: 0;
    color: #747d84;
    font-size: .82rem;
    line-height: 1.55;
}

.jugador-confirmacion-mensaje {
    margin: 14px 0 0;
    border-left: 3px solid #bd4a4a;
    padding: 9px 11px;
    background: #fff6f6;
    color: #923b3b;
    font-size: .8rem;
}

.jugador-confirmacion-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px 22px;
}

.jugador-btn-confirmar-desactivar {
    min-height: 40px;
    border: 1px solid #a93f3f;
    border-radius: 5px;
    padding: 9px 17px;
    background: #ad4444;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.jugador-btn-confirmar-desactivar:hover {
    background: #963838;
    box-shadow: 0 4px 12px rgba(150, 56, 56, .18);
    transform: translateY(-1px);
}

.jugador-btn-confirmar-desactivar:active {
    transform: translateY(0);
}

.jugador-btn-confirmar-desactivar:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 760px) {
    .jugador-form-acciones {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .jugador-form-acciones-derecha {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .jugador-btn-desactivar {
        width: fit-content;
        align-self: center;
    }

    .jugador-confirmacion {
        align-items: flex-end;
        padding: 12px;
    }

    .jugador-confirmacion-card {
        width: 100%;
        border-radius: 12px;
        transform: translateY(18px);
    }

    .jugador-confirmacion-cabecera,
    .jugador-confirmacion-contenido {
        padding-left: 18px;
        padding-right: 18px;
    }

    .jugador-confirmacion-acciones {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 16px 18px 18px;
    }
}

/* Términos del primer ingreso: mantiene el estilo sencillo del portal de fichas. */
.terminos-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.terminos-wrap {
    width: min(920px, 100%);
    margin: 32px auto 70px;
    background: #fff;
    padding: 38px 46px 34px;
    box-shadow: 0 5px 18px rgba(17, 50, 79, .10);
}

.terminos-encabezado {
    padding-bottom: 22px;
    border-bottom: 1px solid #dcdcdc;
}

.terminos-encabezado p {
    margin: 0 0 4px;
    color: #2f7fba;
    font-size: .86rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.terminos-encabezado h1 {
    margin: 0 0 6px;
    color: #2f3142;
    font-size: 2rem;
    font-weight: 700;
}

.terminos-encabezado span {
    color: #727272;
    font-size: .95rem;
}

.terminos-contenido {
    padding: 27px 0 8px;
    color: #303030;
    line-height: 1.65;
}

.terminos-contenido h2 {
    margin: 24px 0 7px;
    color: #173f62;
    font-size: 1.03rem;
    font-weight: 700;
}

.terminos-contenido p {
    margin: 0;
}

.terminos-check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 26px;
    padding: 18px 0;
    border-top: 1px solid #e3e3e3;
    border-bottom: 1px solid #e3e3e3;
    color: #242424;
    cursor: pointer;
}

.terminos-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #20ad45;
    flex: 0 0 auto;
}

.terminos-acciones {
    display: flex;
    justify-content: flex-end;
    padding-top: 24px;
}

.terminos-acciones .btn-siguiente {
    min-width: 210px;
}

.terminos-acciones .btn-siguiente:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.terminos-footer {
    margin-top: auto;
}

.terminos-footer span {
    margin-left: 18px;
    color: inherit;
}

@media (max-width: 700px) {
    .terminos-wrap {
        margin: 18px auto 40px;
        padding: 28px 22px 26px;
    }

    .terminos-encabezado h1 {
        font-size: 1.55rem;
    }

    .terminos-acciones {
        display: block;
    }

    .terminos-acciones .btn-siguiente {
        width: 100%;
    }
}

/* Documento legal de primer ingreso. Se mantiene simple y legible. */
.terminos-documento {
    margin-top: 22px;
    border: 1px solid #d8dee6;
    background: #fff;
}

.terminos-documento-cabecera {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #d8dee6;
    background: #f7f8fa;
    font-size: 14px;
}

.terminos-documento-cabecera span {
    color: #667085;
    text-align: right;
}

.terminos-documento .terminos-contenido {
    max-height: 470px;
    overflow-y: auto;
    padding: 20px 22px;
    line-height: 1.55;
}

.terminos-documento .terminos-contenido h2 {
    margin: 24px 0 10px;
    font-size: 18px;
}

.terminos-documento .terminos-contenido h3 {
    margin: 15px 0 7px;
    font-size: 15px;
    font-weight: 700;
}

.terminos-documento .terminos-contenido ul {
    margin: 0 0 14px 20px;
    padding: 0;
}

.terminos-documento .terminos-contenido li {
    margin-bottom: 7px;
}

@media (max-width: 700px) {
    .terminos-documento-cabecera {
        flex-direction: column;
        gap: 4px;
    }

    .terminos-documento-cabecera span {
        text-align: left;
    }

    .terminos-documento .terminos-contenido {
        max-height: 430px;
        padding: 17px;
    }
}

/* Componente reutilizable para recortar fotografías de jugadores. */
.foto-recorte-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.foto-recorte-modal.d-none { display: none !important; }

.foto-recorte-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 28, 44, .76);
    backdrop-filter: blur(4px);
}

.foto-recorte-card {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    color: #263247;
    box-shadow: 0 26px 80px rgba(0,0,0,.34);
}

.foto-recorte-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-bottom: 1px solid #e4e9ef;
}

.foto-recorte-header small {
    color: #16883a;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.foto-recorte-header h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.foto-recorte-header p {
    margin: 5px 0 0;
    color: #7c8795;
    font-size: .82rem;
}

.foto-recorte-cerrar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #e1e6ec;
    border-radius: 50%;
    background: #fff;
    color: #7c8795;
    font-size: 23px;
    cursor: pointer;
}

.foto-recorte-contenido {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 26px;
}

.foto-recorte-lienzo {
    position: relative;
    width: min(360px, 70vw);
    aspect-ratio: 3 / 4;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #17202a;
    touch-action: none;
    cursor: grab;
}

.foto-recorte-lienzo:active { cursor: grabbing; }

.foto-recorte-lienzo img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    user-select: none;
    pointer-events: none;
    transform-origin: 0 0;
}

.foto-recorte-guia {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: inset 0 0 0 999px rgba(0,0,0,.08);
    pointer-events: none;
}

.foto-recorte-controles {
    width: min(260px, 100%);
}

.foto-recorte-controles label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    font-size: .85rem;
}

.foto-recorte-controles input { width: 100%; }

.foto-recorte-controles span {
    display: block;
    margin-top: 10px;
    color: #7c8795;
    font-size: .75rem;
    line-height: 1.45;
}

.foto-recorte-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e4e9ef;
}

@media (max-width: 700px) {
    .foto-recorte-contenido { flex-direction: column; }
    .foto-recorte-controles { width: 100%; }
}

/* Panel de encuadre: guía y vista previa comparten proporción 3:4. */
.image-cropper-open { overflow: hidden; }
.foto-recorte-card { max-height: calc(100dvh - 48px); }
.foto-recorte-lienzo { width: min(300px, 70vw); box-sizing: content-box; }
.foto-recorte-lienzo:focus-visible { outline: 3px solid #16883a; outline-offset: 4px; }
.foto-recorte-guia svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 7 5; filter: drop-shadow(0 1px 2px #263247); }
.foto-recorte-controles h3 { font-size: .9rem; font-weight: 800; margin: 0 0 10px; }
.foto-recorte-pasos { padding-left: 18px; color: #526173; font-size: .82rem; line-height: 1.6; }
.foto-recorte-controles input { accent-color: #16883a; min-height: 32px; }
.foto-recorte-restablecer { border: 1px solid #d8e1e9; border-radius: 8px; background: #f5f7fa; padding: 8px 12px; color: #34475d; font-size: .8rem; margin: 8px 0 18px; }
#fotoRecortePreview { display: block; width: 105px; height: 140px; border-radius: 6px; background: #edf1f5; box-shadow: 0 3px 12px #26324722; }
.foto-recorte-error { color: #b42318; font-size: .8rem; margin: 12px 0 0; }
.foto-recorte-error:empty { display: none; }
.foto-recorte-acciones button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 700px) {
    .foto-recorte-modal { padding: 10px; }
    .foto-recorte-card { max-height: calc(100dvh - 20px); }
    .foto-recorte-header { padding: 16px; }
    .foto-recorte-contenido { padding: 16px; gap: 18px; }
    .foto-recorte-lienzo { width: min(240px, 65vw); }
    .foto-recorte-acciones { position: sticky; bottom: 0; background: #fff; padding: 12px 16px; }
    .foto-recorte-acciones button { flex: 1; }
}


/* ===== Teléfonos internacionales =====
 * El selector y el número se presentan como un único control para que el
 * formulario conserve una apariencia limpia y consistente. */
.telefono-internacional {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 46px;
    overflow: hidden;
    border: 1px solid #d7dbe3;
    border-radius: 9px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.telefono-internacional:hover {
    border-color: #b8c2cf;
}

.telefono-internacional:focus-within {
    border-color: var(--ficha-azul);
    box-shadow: 0 0 0 3px rgba(46, 121, 184, .12);
}

.telefono-internacional .telefono-pais {
    flex: 0 0 205px;
    min-width: 0;
    padding: 0 34px 0 12px;
    border: 0;
    border-right: 1px solid #e2e6ec;
    border-radius: 0;
    background-color: #f7f9fb;
    color: #34475d;
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.telefono-internacional input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-left: 14px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none !important;
    outline: none;
}

.telefono-internacional input:focus {
    border: 0 !important;
    box-shadow: none !important;
}

@media (max-width: 620px) {
    .telefono-internacional .telefono-pais {
        flex-basis: 170px;
        padding-left: 10px;
        font-size: .82rem;
    }

    .telefono-internacional input {
        padding-left: 11px;
    }
}

/* ===== Menú personalizado del selector de país =====
 * Reemplaza visualmente el desplegable nativo para mantener la estética de la ficha. */
.telefono-internacional { overflow: visible; position: relative; }
.telefono-internacional .telefono-pais {
    position: relative;
    flex: 0 0 112px;
    padding: 0;
    border: 0;
    border-right: 1px solid #e2e6ec;
    background: #f7f9fb;
    font: inherit;
}
.telefono-pais-boton {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 100%; min-height: 44px;
    padding: 0 12px; border: 0; background: transparent; color: #34475d; cursor: pointer; font: inherit;
}
.telefono-pais-boton:hover { background: #eef5fb; }
.telefono-pais-bandera { font-size: 1.15rem; line-height: 1; }
.telefono-pais-codigo { font-size: .86rem; font-weight: 700; }
.telefono-pais-flecha { margin-left: auto; width: 7px; height: 7px; border-right: 2px solid #587089; border-bottom: 2px solid #587089; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.telefono-pais.is-open .telefono-pais-flecha { transform: rotate(225deg) translate(-2px,-2px); }
.telefono-pais-menu {
    position: absolute; z-index: 1000; top: calc(100% + 8px); left: 0; width: 320px; max-width: min(320px, calc(100vw - 32px));
    padding: 8px; border: 1px solid #d9e2eb; border-radius: 12px; background: #fff;
    box-shadow: 0 12px 32px rgba(34, 61, 88, .18); overflow: hidden;
}
.telefono-pais-menu[hidden] { display: none !important; }
.telefono-pais-buscador-wrap { padding: 3px 3px 8px; }
.telefono-internacional .telefono-pais-buscador {
    box-sizing: border-box; width: 100%; min-height: 38px; padding: 8px 11px 8px 34px !important;
    border: 1px solid #dce4ec !important; border-radius: 8px !important; outline: 0; background: #f7f9fb;
    color: #34475d; font-size: .84rem; box-shadow: none !important;
    background-image: radial-gradient(circle at 16px 16px, transparent 5px, #7a8da0 5px, #7a8da0 6px, transparent 6px);
}
.telefono-internacional .telefono-pais-buscador:focus { border-color: var(--ficha-azul) !important; background-color: #fff; box-shadow: 0 0 0 3px rgba(46,121,184,.10) !important; }
.telefono-pais-opciones { max-height: 270px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #b8c8d8 transparent; }
.telefono-pais-opcion {
    display: grid; grid-template-columns: 28px minmax(0,1fr) auto 20px; align-items: center; gap: 8px;
    width: 100%; min-height: 42px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent;
    color: #34475d; text-align: left; cursor: pointer; font: inherit; transition: background .14s ease, color .14s ease;
}
.telefono-pais-opcion:hover, .telefono-pais-opcion:focus-visible { outline: 0; background: #edf6fc; color: #236ca5; }
.telefono-pais-opcion.is-selected { background: #e6f2fb; color: #216b9f; }
.telefono-pais-opcion-bandera { font-size: 1.08rem; }
.telefono-pais-opcion-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 600; }
.telefono-pais-opcion-codigo { color: #718296; font-size: .8rem; font-weight: 600; }
.telefono-pais-check { color: var(--ficha-azul); font-weight: 800; opacity: 0; }
.telefono-pais-opcion.is-selected .telefono-pais-check { opacity: 1; }
@media (max-width: 620px) {
    .telefono-internacional .telefono-pais { flex-basis: 102px; }
    .telefono-pais-boton { padding: 0 9px; gap: 6px; }
    .telefono-pais-menu { width: min(300px, calc(100vw - 28px)); }
}


/* Ayuda de longitud para teléfonos: informa sin recargar visualmente el formulario. */
.telefono-longitud-ayuda {
    display: block;
    margin: 5px 2px 0;
    color: #7a8998;
    font-size: .76rem;
    line-height: 1.25;
    transition: color .15s ease;
}
.telefono-longitud-ayuda.is-error { color: #b42318; }
.telefono-internacional:has(+ .telefono-longitud-ayuda.is-error) {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, .08);
}

/* ===== Editor de fotografía moderno =====
 * La fotografía y el zoom forman una misma columna; la vista previa queda aparte.
 * Se mantienen las proporciones 3:4 y el área táctil original del recortador.
 */
.foto-recorte-card { width: min(900px, 100%); border-radius: 18px; }
.foto-recorte-header small { color: #246bdb; }
.foto-recorte-header h2 { color: #183c67; }
.foto-recorte-contenido { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 240px); align-items: start; gap: 24px; padding: 22px 24px; }
.foto-recorte-editor { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.foto-recorte-lienzo { width: min(100%, 355px); box-sizing: border-box; border-radius: 10px; box-shadow: 0 10px 24px #172c4b24; }
.foto-recorte-zoom { display: flex; align-items: end; gap: 12px; width: min(100%, 355px); margin-top: 16px; }
.foto-recorte-zoom button { flex: 0 0 42px; height: 42px; border: 1px solid #dce4ee; border-radius: 50%; background: #f5f8fc; color: #1b4f91; font-size: 24px; line-height: 1; cursor: pointer; }
.foto-recorte-zoom button:hover { background: #e7f0ff; }
.foto-recorte-zoom button:disabled { opacity: .5; cursor: not-allowed; }
.foto-recorte-zoom-range { flex: 1; min-width: 0; display: flex !important; flex-direction: column; gap: 7px; margin: 0 !important; text-align: center; }
.foto-recorte-zoom-titulo { font-size: .76rem; font-weight: 700; color: #607187; }
.foto-recorte-zoom input { display: block; width: 100%; min-height: 30px; margin: 0; accent-color: #246bdb; cursor: pointer; }
.foto-recorte-indicacion { max-width: 355px; margin: 13px 0 0; color: #6d7c8f; font-size: .78rem; line-height: 1.5; text-align: center; }
.foto-recorte-restablecer { margin: 13px 0 0; border-color: #dce4ee; color: #284b77; background: #fff; font-weight: 700; cursor: pointer; }
.foto-recorte-restablecer:hover { background: #f0f5fd; }
.foto-recorte-controles { box-sizing: border-box; width: 100%; padding: 18px; border-radius: 12px; background: #f5f8fc; }
.foto-recorte-controles h3 { margin: 0 0 15px; color: #233b5b; font-size: 1rem; }
.foto-recorte-preview-caja { display: flex; justify-content: center; padding: 6px; }
#fotoRecortePreview { width: min(150px, 100%); height: auto; aspect-ratio: 3/4; object-fit: contain; border-radius: 8px; }
.foto-recorte-controles span { margin-top: 16px; text-align: center; }
.foto-recorte-acciones .jugador-btn-guardar { background: #246bdb; border-color: #246bdb; }
@media (max-width: 700px) {
    .foto-recorte-contenido { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 16px; }
    .foto-recorte-lienzo { width: min(100%, 300px); }
    .foto-recorte-controles { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px; }
    .foto-recorte-controles h3 { flex: 1 0 100%; margin: 0; }
    .foto-recorte-preview-caja { flex: 0 0 70px; padding: 0; }
    #fotoRecortePreview { width: 70px; }
    .foto-recorte-controles span { flex: 1; margin: 0; text-align: left; }
    .foto-recorte-error { flex: 1 0 100%; }
}

/* ===== Experiencia de ajuste fotográfico =====
 * Solo presentación: no altera el canvas, el recorte 3:4 ni los archivos generados.
 */
.foto-recorte-modal { padding: 18px; }
.foto-recorte-backdrop { background: rgba(9,22,42,.78); backdrop-filter: blur(7px); }
.foto-recorte-card { width: min(880px,100%); border: 1px solid #e7edf6; border-radius: 22px; box-shadow: 0 30px 90px #07152a55; }
.foto-recorte-header { padding: 23px 28px 19px; background: linear-gradient(110deg,#f5f9ff,#fff 72%); }
.foto-recorte-header small { color: #246bdb; font-size: .68rem; letter-spacing: .13em; }
.foto-recorte-header h2 { font-size: 1.5rem; letter-spacing: -.035em; }
.foto-recorte-header p { font-size: .86rem; color: #61718a; }
.foto-recorte-cerrar { transition: background .18s, transform .18s; }
.foto-recorte-cerrar:hover { background: #eaf0fa; transform: rotate(90deg); }
.foto-recorte-contenido { grid-template-columns: minmax(0,1fr) 220px; gap: 22px; padding: 22px 26px; }
.foto-recorte-editor { padding: 17px; background: #f3f6fb; border: 1px solid #e5ebf4; border-radius: 17px; }
.foto-recorte-etapa { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 11px; }
.foto-recorte-etiqueta { display: block; align-self: flex-start; color: #47617f; font-size: .75rem; font-weight: 800; letter-spacing: .015em; }
.foto-recorte-lienzo { width: min(100%,300px); border: 3px solid white; border-radius: 12px; box-shadow: 0 9px 30px #10294835; transition: box-shadow .2s; }
.foto-recorte-lienzo:hover { box-shadow: 0 12px 32px #10294855; }
.foto-recorte-guia { border-radius: 9px; }
.foto-recorte-zoom { width: min(100%,355px); margin-top: 15px; gap: 11px; align-items: center; }
.foto-recorte-zoom-range { gap: 5px; }
.foto-recorte-zoom-titulo { display: flex; align-items: center; justify-content: space-between; color: #47617f; text-align: left; font-size: .75rem; }
#fotoRecortePorcentaje { color: #195ac1; font-size: .85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.foto-recorte-zoom button { flex-basis: 39px; height: 39px; background: white; border-radius: 12px; font-weight: 700; transition: background .18s, transform .18s; }
.foto-recorte-zoom button:not(:disabled):hover { transform: translateY(-2px); background: #e5efff; }
.foto-recorte-zoom input { min-height: 26px; accent-color: #246bdb; }
.foto-recorte-indicacion { margin: 11px 0 0; color: #60718a; font-size: .73rem; }
.foto-recorte-restablecer { margin: 12px 0 0; border-radius: 10px; background: white; transition: background .18s; }
.foto-recorte-controles { padding: 17px; background: #f5f9ff; border: 1px solid #e3ecfa; border-radius: 16px; }
.foto-recorte-controles h3 { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin: 10px 0 13px; font-size: .95rem; }
.foto-recorte-en-vivo { color: #168348 !important; font-size: .66rem !important; margin: 0 !important; font-weight: 700; white-space: nowrap; }
.foto-recorte-preview-caja { padding: 12px; border-radius: 12px; background: white; border: 1px solid #e5ebf3; }
#fotoRecortePreview { width: 135px; max-width: 100%; }
.foto-recorte-controles > span:not(.foto-recorte-etiqueta) { margin-top: 13px; }
.foto-recorte-acciones { align-items: center; padding: 16px 26px; background: #fff; }
.foto-recorte-acciones button { min-height: 43px; border-radius: 10px; font-weight: 800; }
.foto-recorte-acciones .jugador-btn-guardar { background: #246bdb; border-color: #246bdb; box-shadow: 0 5px 14px #246bdb33; }
.foto-recorte-acciones .jugador-btn-guardar:not(:disabled):hover { background: #1555b8; }
@media(max-width:700px) {
 .foto-recorte-modal { padding: 8px; }
 .foto-recorte-card { max-height: calc(100dvh - 16px); border-radius: 16px; }
 .foto-recorte-header { padding: 16px; }
 .foto-recorte-header h2 { font-size: 1.22rem; }
 .foto-recorte-contenido { padding: 12px; gap: 12px; }
 .foto-recorte-editor { padding: 12px; }
 .foto-recorte-lienzo { width: min(100%,240px); }
 .foto-recorte-controles { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 6px 12px; padding: 12px; }
 .foto-recorte-controles .foto-recorte-etiqueta,.foto-recorte-controles h3,.foto-recorte-error { grid-column: 1/-1; }
 .foto-recorte-controles h3 { margin: 0; }
 .foto-recorte-preview-caja { padding: 5px; }
 #fotoRecortePreview { width: 68px; }
 .foto-recorte-controles > span:not(.foto-recorte-etiqueta) { margin: 0; text-align: left; }
 .foto-recorte-acciones { padding: 11px 12px; }
}
@media(prefers-reduced-motion:reduce) { .foto-recorte-card * { transition: none !important; } }

/* ===== Modal de fotografía compacto (ajuste visual) =====
 * Reduce el espacio ocupado en escritorio y portátiles sin cambiar la
 * proporción 3:4, el comportamiento del zoom ni el procesamiento de imagen.
 */
.foto-recorte-modal { padding: 12px; }
.foto-recorte-card {
    width: min(720px, 100%);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
}
.foto-recorte-header { padding: 13px 19px 12px; gap: 12px; }
.foto-recorte-header h2 { font-size: 1.22rem; }
.foto-recorte-header p { font-size: .77rem; margin-top: 3px; }
.foto-recorte-cerrar { width: 32px; height: 32px; flex-basis: 32px; }
.foto-recorte-contenido { gap: 14px; padding: 14px 18px; }
.foto-recorte-editor { padding: 12px; }
.foto-recorte-etapa { gap: 7px; }
.foto-recorte-lienzo { width: min(100%, 230px); }
.foto-recorte-zoom { margin-top: 8px; gap: 7px; }
.foto-recorte-zoom button { height: 32px; flex-basis: 32px; border-radius: 9px; }
.foto-recorte-indicacion { margin-top: 6px; }
.foto-recorte-restablecer { margin-top: 7px; padding: 6px 10px; }
.foto-recorte-controles { padding: 12px; }
.foto-recorte-controles h3 { margin: 5px 0 9px; }
.foto-recorte-preview-caja { padding: 8px; }
#fotoRecortePreview { width: 105px; height: auto; aspect-ratio: 3 / 4; }
.foto-recorte-acciones { padding: 10px 18px; }
.foto-recorte-acciones button { min-height: 37px; }
@media (max-width: 700px) {
    .foto-recorte-modal { padding: 7px; }
    .foto-recorte-card { width: 100%; max-height: calc(100dvh - 14px); }
    .foto-recorte-header { padding: 11px 13px; }
    .foto-recorte-contenido { padding: 10px; gap: 10px; }
    .foto-recorte-editor { padding: 10px; }
    .foto-recorte-lienzo { width: min(100%, 205px, 22.5dvh); }
    .foto-recorte-controles { padding: 9px; }
    .foto-recorte-acciones { padding: 9px 12px; }
}
@media (max-height: 650px) and (min-width: 701px) {
    .foto-recorte-lienzo { width: min(205px, 100%); }
    .foto-recorte-header { padding-block: 9px; }
    .foto-recorte-contenido { padding-block: 9px; }
}

/* ===== Editor de foto: vista compacta sin desplazamiento en escritorio =====
 * La anchura del lienzo se adapta a la altura disponible, conservando 3:4.
 * En pantallas muy pequeñas se permite desplazamiento para no ocultar controles.
 */
@media (min-width: 701px) {
  .foto-recorte-modal { padding: 10px; }
  .foto-recorte-card {
    width: min(690px, 100%);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }
  .foto-recorte-header { padding: 9px 17px 8px; }
  .foto-recorte-header small { font-size: .60rem; line-height: 1.15; }
  .foto-recorte-header h2 { font-size: 1.12rem; margin: 2px 0 0; line-height: 1.15; }
  .foto-recorte-header p { font-size: .73rem; margin: 2px 0 0; line-height: 1.2; }
  .foto-recorte-contenido {
    grid-template-columns: minmax(0, 1fr) 175px;
    gap: 10px;
    padding: 9px 13px;
    align-items: start;
  }
  .foto-recorte-editor { padding: 9px 10px; }
  .foto-recorte-etapa { gap: 5px; }
  .foto-recorte-etiqueta { font-size: .69rem; line-height: 1.2; }
  .foto-recorte-lienzo {
    width: min(100%, 225px, calc((100dvh - 265px) * .75));
    min-width: 0;
    border-width: 2px;
  }
  .foto-recorte-zoom { width: min(100%, 300px); margin-top: 6px; gap: 7px; }
  .foto-recorte-zoom button { height: 29px; flex-basis: 29px; font-size: 20px; }
  .foto-recorte-zoom-range { gap: 1px; }
  .foto-recorte-zoom input { min-height: 19px; }
  .foto-recorte-indicacion { margin: 4px 0 0; font-size: .68rem; line-height: 1.25; }
  .foto-recorte-restablecer { margin: 5px 0 0; padding: 5px 9px; font-size: .72rem; }
  .foto-recorte-controles { padding: 9px; }
  .foto-recorte-controles h3 { margin: 4px 0 7px; font-size: .85rem; }
  .foto-recorte-preview-caja { padding: 6px; }
  #fotoRecortePreview { width: 92px; }
  .foto-recorte-controles > span:not(.foto-recorte-etiqueta) { margin-top: 8px; font-size: .69rem; line-height: 1.3; }
  .foto-recorte-acciones { padding: 8px 13px; }
  .foto-recorte-acciones button { min-height: 34px; padding: 6px 11px; font-size: .79rem; }
}
@media (max-width: 700px) {
  .foto-recorte-lienzo { width: min(100%, 195px, calc((100dvh - 400px) * .75)); }
  .foto-recorte-indicacion { font-size: .68rem; line-height: 1.25; }
}

/* Corrección solicitada: botón de reinicio del encuadre más visible y fácil de pulsar. */
.foto-recorte-restablecer { min-width: 220px; min-height: 46px; padding: 11px 22px; font-size: .92rem; font-weight: 800; }
@media(max-width:700px){ .foto-recorte-restablecer{width:100%;max-width:355px;} }

/* ===== Ajustes finales solicitados: términos y editor de fotografía =====
 * 1) El CTA de términos usa el mismo lenguaje visual de los botones principales.
 * 2) En escritorio el editor de fotografía recupera espacio de trabajo sin alterar
 *    la lógica, proporción 3:4 ni comportamiento del recortador.
 * 3) Reiniciar se presenta como un botón secundario claro y consistente.
 */
.terminos-acciones .btn-siguiente {
    min-width: 220px;
    min-height: 46px;
    padding: 11px 24px;
    border: 0;
    border-radius: 24px;
    background: #2e79b8;
    color: #fff;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 5px 12px rgba(25, 77, 122, .18);
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.terminos-acciones .btn-siguiente:hover:not(:disabled) {
    background: #24699f;
    transform: translateY(-1px);
    box-shadow: 0 7px 15px rgba(25, 77, 122, .22);
}
.terminos-acciones .btn-siguiente:focus-visible {
    outline: 3px solid rgba(46, 121, 184, .25);
    outline-offset: 3px;
}
.terminos-acciones .btn-siguiente:disabled {
    background: #b9c1ca;
    color: #fff;
    opacity: .72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (min-width: 701px) {
    .foto-recorte-card {
        width: min(860px, calc(100vw - 28px));
        max-height: calc(100dvh - 24px);
    }
    .foto-recorte-header { padding: 13px 20px 12px; }
    .foto-recorte-header small { font-size: .66rem; }
    .foto-recorte-header h2 { font-size: 1.28rem; }
    .foto-recorte-header p { font-size: .78rem; }
    .foto-recorte-contenido {
        grid-template-columns: minmax(0, 1fr) 200px;
        gap: 14px;
        padding: 12px 16px;
    }
    .foto-recorte-editor { padding: 12px 14px; }
    .foto-recorte-etiqueta { font-size: .76rem; }
    .foto-recorte-lienzo {
        width: min(100%, 285px, calc((100dvh - 300px) * .75));
    }
    .foto-recorte-zoom { width: min(100%, 340px); margin-top: 9px; }
    .foto-recorte-zoom button { height: 34px; flex-basis: 34px; font-size: 21px; }
    .foto-recorte-indicacion { margin-top: 7px; font-size: .72rem; }
    .foto-recorte-controles { padding: 12px; }
    .foto-recorte-controles h3 { font-size: .9rem; }
    #fotoRecortePreview { width: 108px; }
    .foto-recorte-acciones { padding: 10px 16px; }
    .foto-recorte-acciones button { min-height: 39px; padding: 7px 13px; font-size: .82rem; }
}

.foto-recorte-restablecer {
    min-width: 190px;
    min-height: 40px;
    margin-top: 10px;
    padding: 8px 18px;
    border: 1px solid #cfdbea;
    border-radius: 10px;
    background: #fff;
    color: #284b77;
    font-size: .84rem;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(24, 60, 103, .06);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.foto-recorte-restablecer:hover {
    background: #eef5ff;
    border-color: #aac3e2;
    box-shadow: 0 4px 9px rgba(24, 60, 103, .10);
    transform: translateY(-1px);
}
.foto-recorte-restablecer:focus-visible {
    outline: 3px solid rgba(36, 107, 219, .18);
    outline-offset: 2px;
}
@media (max-width: 700px) {
    .terminos-acciones .btn-siguiente { width: 100%; }
    .foto-recorte-restablecer { width: 100%; max-width: 355px; }
}
