* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    min-height: 100vh;
    background-image: 
        linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%),
        url('fondo.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 1.5rem;
    position: relative;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner-grande {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(46, 204, 113, 0.2);
    border-top: 5px solid #2ecc71;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-text {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.contenido {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.8rem 0 0.5rem;
    min-height: 100vh;
    justify-content: space-between;
    transition: filter 0.3s ease;
}

.contenido.difuminado {
    filter: blur(4px);
    pointer-events: none;
}

.top-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-svg {
    width: 130px;
    height: 130px;
    margin-top: 1.8rem;
    margin-bottom: 1.2rem;
    display: block;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.25));
    transition: transform 0.2s ease;
}

.logo-svg:hover {
    transform: scale(1.03);
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 0.2rem;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hola-titulo {
    font-size: 3.2rem;
    color: #2ecc71;
    text-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
    animation: holaAnim 0.5s ease;
}

@keyframes holaAnim {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.subhead {
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    padding: 0.3rem 2rem;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 2.5rem;
    display: inline-block;
}

.input-group-directo {
    width: 100%;
    max-width: 440px;
    text-align: left;
    margin-bottom: 0.5rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.phone-wrapper-directo {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.25s ease;
    border-radius: 16px;
    overflow: hidden;
}

.phone-wrapper-directo:focus-within {
    border-color: #2ecc71;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.2);
}

.codigo-pais {
    font-weight: 600;
    color: #1a3a2a;
    padding: 0.9rem 0.5rem 0.9rem 1.2rem;
    font-size: 1rem;
    white-space: nowrap;
    background: #f0f5f2;
    border-right: 1px solid #d0ddd6;
}

#phoneInput {
    flex: 1;
    background: #ffffff;
    border: none;
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #1a2a1a;
    outline: none;
    min-width: 0;
    border-radius: 0px;
}

#phoneInput::placeholder {
    color: #889e92;
    font-weight: 400;
    font-size: 0.95rem;
    opacity: 1;
}

#passwordInput {
    flex: 1;
    background: #ffffff;
    border: none;
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #1a2a1a;
    outline: none;
    min-width: 0;
    border-radius: 0px;
}

#passwordInput::placeholder {
    color: #889e92;
    font-weight: 400;
    font-size: 0.95rem;
    opacity: 1;
}

#phoneInput::-webkit-outer-spin-button,
#phoneInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#phoneInput {
    -moz-appearance: textfield;
    appearance: textfield;
}

.feedback-directo {
    width: 100%;
    max-width: 440px;
    margin-top: 0.9rem;
    font-size: 0.85rem;
    min-height: 1.6rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.2s;
    text-align: center;
    border-radius: 12px;
}

.feedback-directo.error {
    color: #ffb3a0;
    background: rgba(200, 50, 30, 0.2);
    border-color: rgba(255, 100, 80, 0.15);
}

.feedback-directo.success {
    color: #a8ffc0;
    background: rgba(30, 180, 70, 0.15);
    border-color: rgba(46, 204, 113, 0.15);
}

.btn-siguiente-directo {
    width: 100%;
    max-width: 440px;
    padding: 1rem 1.5rem;
    margin-top: 2.5rem;
    background: linear-gradient(145deg, #27ae60, #1e8449);
    border: none;
    border-radius: 60px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0, 60, 20, 0.35);
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 3px solid #1a6e3a;
}

.btn-siguiente-directo:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 70, 25, 0.45);
    background: linear-gradient(145deg, #2ecc71, #219a52);
    border-bottom-color: #157a3e;
}

.btn-siguiente-directo:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-siguiente-directo:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-siguiente-directo i {
    font-size: 1.1rem;
    opacity: 0.8;
    transition: transform 0.2s;
}

.btn-siguiente-directo:hover:not(:disabled) i {
    transform: translateX(4px);
}

.footer {
    width: 100%;
    max-width: 440px;
    margin-top: 3rem;
    padding: 1.2rem 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.footer-logos .footer-logo {
    width: 50px;
    height: 50px;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

.footer-logos .footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.footer-logos .footer-photo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.footer-logos .footer-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0.2rem 0;
}

.footer .footer-links a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.2s;
}

.footer .footer-links a:hover {
    color: rgba(255, 255, 255, 0.7);
}

.footer p {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.3px;
    margin: 0;
}

@media (max-width: 480px) {
    .contenido { padding: 1rem 0 0.5rem; }
    .logo-svg { width: 100px; height: 100px; margin-top: 1rem; }
    h1 { font-size: 2.2rem; }
    .hola-titulo { font-size: 2.6rem; }
    .codigo-pais { padding: 0.7rem 0.4rem 0.7rem 0.8rem; font-size: 0.9rem; }
    #phoneInput { padding: 0.7rem 0.8rem; font-size: 1rem; }
    #passwordInput { padding: 0.7rem 0.8rem; font-size: 1rem; }
    .btn-siguiente-directo { padding: 0.8rem 1.2rem; font-size: 1.1rem; border-radius: 50px; margin-top: 2rem; }
    .phone-wrapper-directo { border-radius: 14px; }
    .footer { margin-top: 2rem; padding: 1rem 0; }
    .footer .footer-links { gap: 1rem; }
    .footer-logos .footer-logo { width: 40px; height: 40px; }
    .footer-logos .footer-photo { width: 32px; height: 32px; }
    .spinner-grande { width: 55px; height: 55px; border-width: 4px; }
}

@media (max-width: 380px) {
    .logo-svg { width: 80px; height: 80px; }
    h1 { font-size: 1.8rem; }
    .hola-titulo { font-size: 2.2rem; }
    .subhead { font-size: 0.9rem; padding: 0.2rem 1.2rem; }
    .btn-siguiente-directo { border-radius: 40px; margin-top: 1.8rem; }
    .footer-logos .footer-logo { width: 36px; height: 36px; }
    .footer-logos .footer-photo { width: 28px; height: 28px; }
    .spinner-grande { width: 45px; height: 45px; border-width: 3px; }
}