* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.spinner-overlay.activo {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e6f0ff;
    border-top: 5px solid #0368ec;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
}

@keyframes girar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 20px;
}

.modal-overlay.activo {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 30px 25px 25px;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.25s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-overlay.activo .modal {
    transform: scale(1);
}

.modal-icono {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #ffebee;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.modal-icono svg {
    width: 38px;
    height: 38px;
    stroke: #e53935;
}

.modal-titulo {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.modal-texto {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.4;
}

.modal .btn-primary {
    width: 100%;
}

.encabezado {
    width: 100%;
    background-color: #0368ec;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.encabezado-izq {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.encabezado-der {
    display: flex;
    align-items: center;
}

.menu-hamburguesa {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    padding: 0;
}

.menu-hamburguesa span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-hamburguesa.activo span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.menu-hamburguesa.activo span:nth-child(2) {
    opacity: 0;
}
.menu-hamburguesa.activo span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.menu-desplegable {
    position: fixed;
    top: 64px;
    right: 0;
    width: 220px;
    background-color: #ffffff;
    box-shadow: -2px 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 0 12px;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 999;
}

.menu-desplegable.abierto {
    transform: translateX(0);
}

.menu-desplegable a {
    text-decoration: none;
    color: #1a1a1a;
    font-size: 15px;
    padding: 12px 20px;
    transition: background 0.2s;
}

.menu-desplegable a:hover {
    background-color: #e6f0ff;
    color: #0368ec;
}

.container {
    background-color: #ffffff;
    width: 100%;
    max-width: 400px;
    min-height: calc(100vh - 64px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 64px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    margin-top: 10px;
}

.back-btn, .help-btn {
    background: #f0f2f5;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.back-btn:hover, .help-btn:hover {
    background: #e4e6eb;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.2;
}

p.subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.4;
}

.input-group {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1.5px solid #0368ec;
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 8px;
    box-shadow: 0 0 0 3px rgba(3, 104, 236, 0.1);
    transition: border 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
    border-color: #0257c7;
    box-shadow: 0 0 0 3px rgba(3, 104, 236, 0.2);
}

.flag-img {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.icono-svg {
    width: 20px;
    height: 20px;
    stroke: #0368ec;
    margin-right: 10px;
    flex-shrink: 0;
}

.prefix {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    padding-right: 12px;
    border-right: 1.5px solid #d0d7de;
    margin-right: 12px;
}

.input-group input {
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    width: 100%;
    color: #1a1a1a;
}

.input-group input::placeholder {
    color: #aaa;
}

.error-msg {
    font-size: 12px;
    color: #e53935;
    min-height: 16px;
    padding-left: 5px;
    margin-bottom: 15px;
    transition: color 0.2s;
}

.oculto {
    display: none;
}

.footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
}

.footer-clave {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
}

.btn-primary {
    background-color: #0368ec;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: #0257c7;
}

.btn-secondary {
    background-color: #e6f0ff;
    color: #0368ec;
    border: none;
    border-radius: 30px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background-color: #d0e2ff;
}

.otp-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    background-color: #f8f9fa;
    border: 1.5px solid #0368ec;
    border-radius: 10px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.otp-input:focus {
    border-color: #0257c7;
    box-shadow: 0 0 0 3px rgba(3, 104, 236, 0.2);
}

.otp-input.lleno {
    background-color: #e6f0ff;
}

.perfil-usuario {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.avatar-circulo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #e6f0ff;
    border: 3px solid #0368ec;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.avatar-circulo svg {
    width: 50px;
    height: 50px;
    stroke: #0368ec;
}

.bienvenido {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 2px;
    text-align: center;
}

.subtitle-clave {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

.clave-container {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 15px;
    margin-top: 5px;
}

.clave-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #b0c4de;
    background-color: transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.clave-dot.lleno {
    background-color: #0368ec;
    border-color: #0368ec;
    transform: scale(1.1);
}

.clave-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: none;
    background: transparent;
    pointer-events: none;
}

.teclado-numerico {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.tecla {
    background-color: #f8f9fa;
    border: 1.5px solid #e4e6eb;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    padding: 0;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    justify-self: center;
}

.tecla:hover {
    background-color: #e6f0ff;
    border-color: #0368ec;
}

.tecla:active {
    background-color: #0368ec;
    color: #ffffff;
    transform: scale(0.94);
}

.tecla-vacia {
    background: transparent;
    border: none;
    pointer-events: none;
}

.tecla-borrar {
    background-color: #e6f0ff;
    color: #0368ec;
    border-color: #0368ec;
    font-size: 20px;
}

.reenviar {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

.reenviar a {
    color: #0368ec;
    font-weight: 600;
    text-decoration: none;
}

.reenviar a:hover {
    text-decoration: underline;
}

.footer-app {
    width: 100%;
    background-color: #0368ec;
    color: #ffffff;
    margin-top: 20px;
    padding: 30px 20px 20px;
}

.footer-contenido {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-marca {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-logo {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.footer-nombre {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-links a {
    color: #e6f0ff;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-redes {
    display: flex;
    gap: 18px;
    margin-top: 5px;
}

.footer-redes a {
    color: #ffffff;
    transition: opacity 0.2s, transform 0.2s;
}

.footer-redes a:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.footer-redes svg {
    width: 22px;
    height: 22px;
}

.footer-copy {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    width: 100%;
    padding-top: 15px;
    text-align: center;
}

.footer-copy p {
    font-size: 11px;
    color: #cfe0ff;
}