/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #f0f4f8 100%);
    overflow-x: hidden;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

/* ==================== CANVAS PARTÍCULAS ==================== */
#particlesCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ==================== HEADER TOP ROW ==================== */
.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: clamp(10px, 1.5vh, 15px);
}

/* ==================== BOTÓN PWA DENTRO DEL CONTENEDOR ==================== */
.pwa-install-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #0f2b3d, #1a3a4f);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 40px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
    flex-shrink: 0;
}

.pwa-install-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    border-color: rgba(59, 130, 246, 0.3);
}

.pwa-install-btn:active {
    transform: scale(0.95);
}

.pwa-install-btn i {
    font-size: 0.9rem;
    color: #60a5fa;
}

.pwa-install-btn .pwa-btn-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== MODAL PWA ==================== */
.pwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: overlayFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-modal-overlay.active {
    display: flex;
}

@keyframes overlayFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.pwa-modal {
    background: linear-gradient(145deg, #0f2b3d, #1a3a4f);
    border-radius: 32px;
    padding: clamp(35px, 5vh, 50px) clamp(30px, 4vw, 50px);
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 50px 100px -12px rgba(0, 0, 0, 0.6);
    animation: modalBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes modalBounce {
    0% { opacity: 0; transform: scale(0.8) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.pwa-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.pwa-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: rotate(90deg);
}

.pwa-modal-icon {
    width: clamp(70px, 10vw, 90px);
    height: clamp(70px, 10vw, 90px);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(96, 165, 250, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(20px, 3vh, 28px);
    border: 2px solid rgba(59, 130, 246, 0.2);
}

.pwa-modal-icon i {
    font-size: clamp(2rem, 3vw, 2.8rem);
    color: #60a5fa;
}

.pwa-modal-title {
    color: #ffffff;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.pwa-modal-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.6;
    margin-bottom: clamp(18px, 2.5vh, 24px);
}

.pwa-modal-features {
    display: flex;
    justify-content: center;
    gap: clamp(14px, 2vw, 20px);
    margin-bottom: clamp(22px, 3vh, 30px);
}

.pwa-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 70px;
    transition: all 0.3s ease;
}

.pwa-feature:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.pwa-feature i {
    font-size: 1.3rem;
    color: #60a5fa;
}

.pwa-feature span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    font-weight: 500;
}

.pwa-modal-install {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(14px, 2vh, 18px) clamp(24px, 3vw, 32px);
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 100%;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.25);
}

.pwa-modal-install:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.35);
}

.pwa-modal-install:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.pwa-modal-note {
    color: rgba(255, 255, 255, 0.35);
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pwa-modal-note i {
    color: #60a5fa;
}

/* BARRA DE PROGRESO */
.pwa-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin: 16px 0 8px 0;
}

.pwa-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.pwa-progress-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 4px 0 0 0;
}

/* ==================== INSTRUCCIONES iOS ==================== */
.pwa-install-instructions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px;
    margin: 12px 0;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pwa-install-instructions ol {
    text-align: left;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 2;
    padding-left: 20px;
    margin: 0;
}

.pwa-install-instructions ol li strong {
    color: rgba(255, 255, 255, 0.9);
}

.pwa-install-instructions ol li i {
    color: #60a5fa;
}

/* ==================== WRAPPER ==================== */
.login-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.login-container {
    display: grid;
    grid-template-columns: 55% 45%;
    background: #ffffff;
    border-radius: 48px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-height: 680px;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== COLUMNA IZQUIERDA ==================== */
.login-left {
    min-height: 680px;
    position: relative;
    background: linear-gradient(145deg, #0f2b3d 0%, #1a3a4f 50%, #0f2b3d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(30px, 5vh, 50px) clamp(25px, 4vw, 60px);
    overflow: hidden;
}

.left-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbPulse 6s ease-in-out infinite alternate;
}

.orb-1 {
    width: min(500px, 60vw);
    height: min(500px, 60vw);
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: min(400px, 50vw);
    height: min(400px, 50vw);
    background: radial-gradient(circle, #60a5fa 0%, transparent 70%);
    bottom: -10%;
    left: -10%;
    animation-delay: -2s;
}

.orb-3 {
    width: min(300px, 40vw);
    height: min(300px, 40vw);
    background: radial-gradient(circle, #1d4ed8 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: -4s;
}

@keyframes orbPulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
    100% { transform: scale(1.3) translate(20px, -20px); opacity: 0.4; }
}

.left-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 650px;
    animation: slideInLeft 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-60px); }
    100% { opacity: 1; transform: translateX(0); }
}

.logo-section {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
    margin-bottom: clamp(20px, 3vh, 30px);
}

.logo-main {
    width: clamp(50px, 8vw, 70px);
    height: clamp(50px, 8vw, 70px);
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.3));
    animation: logoPulse 4s ease-in-out infinite alternate;
    flex-shrink: 0;
}

@keyframes logoPulse {
    0% { filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.2)); transform: scale(1); }
    100% { filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.5)); transform: scale(1.05); }
}

.brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 900;
    color: white;
    letter-spacing: -1px;
    line-height: 1.2;
}

.brand-name span {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-version {
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
    font-weight: 300;
}

.brand-title-section {
    margin: clamp(15px, 2vh, 20px) 0 clamp(20px, 3vh, 35px) 0;
}

.main-title {
    font-size: clamp(1.6rem, 5vw, 3.8rem);
    font-weight: 800;
    color: white;
    line-height: 1.1;
    letter-spacing: -1px;
}

.title-underline {
    width: clamp(60px, 10vw, 80px);
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    margin-top: clamp(10px, 1.5vh, 15px);
    animation: underlineExpand 2s ease-in-out infinite alternate;
}

@keyframes underlineExpand {
    0% { width: clamp(60px, 10vw, 80px); opacity: 0.5; }
    100% { width: clamp(120px, 20vw, 180px); opacity: 1; }
}

.slogan-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: clamp(16px, 2vw, 20px);
    padding: clamp(16px, 2.5vh, 25px) clamp(18px, 3vw, 30px);
    margin: clamp(15px, 2vh, 25px) 0 clamp(20px, 3vh, 35px) 0;
    position: relative;
    transition: all 0.4s ease;
}

.slogan-box:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.slogan-box i {
    color: rgba(96, 165, 250, 0.3);
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    position: absolute;
}

.slogan-box i:first-child {
    top: clamp(8px, 1.5vh, 15px);
    left: clamp(12px, 2vw, 20px);
}

.slogan-box i:last-child {
    bottom: clamp(8px, 1.5vh, 15px);
    right: clamp(12px, 2vw, 20px);
}

.slogan-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(0.75rem, 1.2vw, 1.05rem);
    line-height: 1.7;
    font-weight: 300;
    padding: 0 clamp(15px, 3vw, 25px);
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
    gap: clamp(10px, 1.5vw, 15px);
    margin-top: 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 400;
    padding: clamp(8px, 1.2vh, 10px) clamp(10px, 1.5vw, 15px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: clamp(10px, 1.2vw, 12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    color: #60a5fa;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    flex-shrink: 0;
}

/* ==================== COLUMNA DERECHA ==================== */
.login-right {
    min-height: 680px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(30px, 5vh, 45px) clamp(30px, 5vw, 55px);
}

.right-content {
    width: 100%;
    max-width: 100%;
    animation: slideInRight 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(60px); }
    100% { opacity: 1; transform: translateX(0); }
}

.login-card {
    width: 100%;
}

.card-header {
    margin-bottom: clamp(24px, 4vh, 35px);
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    background: linear-gradient(135deg, #eef2ff, #dbeafe);
    padding: clamp(6px, 1vh, 8px) clamp(12px, 2vw, 18px) clamp(6px, 1vh, 8px) clamp(10px, 1.5vw, 14px);
    border-radius: 40px;
}

.welcome-badge i {
    color: #3b82f6;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
}

.welcome-badge span {
    color: #1e3a6f;
    font-weight: 600;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
}

.card-header h3 {
    color: #0a1628;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.card-header p {
    color: #6b7a8f;
    font-size: clamp(0.9rem, 1vw, 1rem);
    margin-top: 5px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 2.8vh, 24px);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    color: #1e3a6f;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label i {
    color: #3b82f6;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-field .input-icon-left {
    position: absolute;
    left: clamp(14px, 1.8vw, 18px);
    color: #94a3b8;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.input-field input:focus ~ .input-icon-left {
    color: #3b82f6;
}

.input-field input {
    width: 100%;
    padding: clamp(15px, 2.2vh, 18px) clamp(45px, 6vw, 55px) clamp(15px, 2.2vh, 18px) clamp(45px, 6vw, 55px);
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: clamp(14px, 1.8vw, 18px);
    color: #0a1628;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
    font-family: 'Inter', sans-serif;
    transition: all 0.4s ease;
    outline: none;
    -webkit-appearance: none;
}

.input-field input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-field input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.toggle-pass {
    position: absolute;
    right: clamp(14px, 1.8vw, 18px);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    z-index: 2;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
}

.toggle-pass:hover {
    color: #3b82f6;
}

.input-glow {
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-field input:focus ~ .input-glow {
    left: 0;
    width: 100%;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 5px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    cursor: pointer;
}

.checkbox-label input {
    display: none;
}

.custom-checkbox {
    width: clamp(20px, 2.2vw, 22px);
    height: clamp(20px, 2.2vw, 22px);
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input:checked + .custom-checkbox {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-label input:checked + .custom-checkbox::after {
    content: "✓";
    color: white;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    font-weight: 700;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 1.8vw, 18px);
    padding: clamp(16px, 2.5vh, 20px) clamp(20px, 3vw, 30px);
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    border-radius: clamp(16px, 2vw, 20px);
    color: white;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.25);
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn-login .btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.btn-login:hover .btn-shine {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.35);
}

.btn-login:active {
    transform: scale(0.97);
}

.btn-login i {
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(5px);
}

.card-footer {
    margin-top: clamp(28px, 4.5vh, 38px);
    padding-top: clamp(22px, 3.5vh, 28px);
    border-top: 1px solid #e2e8f0;
}

.divider {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.8vw, 18px);
    margin-bottom: clamp(18px, 2.5vh, 22px);
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.divider-text {
    color: #94a3b8;
    font-size: clamp(0.75rem, 0.85vw, 0.85rem);
    font-weight: 500;
    white-space: nowrap;
}

.social-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 2vw, 18px);
    margin-bottom: clamp(18px, 2.5vh, 22px);
}

.social-btn {
    width: clamp(48px, 5.5vw, 56px);
    height: clamp(48px, 5.5vw, 56px);
    border-radius: clamp(16px, 2vw, 18px);
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: clamp(1.1rem, 1.3vw, 1.3rem);
    -webkit-tap-highlight-color: transparent;
}

.social-btn:hover {
    background: var(--social-color);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    color: #94a3b8;
    font-size: clamp(0.75rem, 0.85vw, 0.85rem);
}

.secure-badge i {
    color: #3b82f6;
}

/* ============================================ */
/* ===== RESPONSIVE PARA EL BOTÓN PWA ===== */
/* ============================================ */

@media (max-width: 1024px) {
    .pwa-install-btn {
        padding: 6px 14px;
        font-size: 0.7rem;
    }
    
    .pwa-install-btn i {
        font-size: 0.8rem;
    }
    
    .pwa-install-btn .pwa-btn-text {
        font-size: 0.65rem;
    }
}

@media (max-width: 850px) {
    .pwa-install-btn {
        padding: 6px 12px;
        font-size: 0.65rem;
        gap: 6px;
    }
    
    .pwa-install-btn i {
        font-size: 0.75rem;
    }
    
    .pwa-install-btn .pwa-btn-text {
        font-size: 0.6rem;
    }
}

@media (max-width: 550px) {
    .pwa-install-btn {
        padding: 5px 10px;
        font-size: 0.6rem;
        gap: 5px;
        border-radius: 30px;
    }
    
    .pwa-install-btn i {
        font-size: 0.7rem;
    }
    
    .pwa-install-btn .pwa-btn-text {
        font-size: 0.55rem;
    }
}

@media (max-width: 400px) {
    .pwa-install-btn {
        padding: 4px 8px;
        font-size: 0.5rem;
        gap: 4px;
        border-radius: 25px;
    }
    
    .pwa-install-btn i {
        font-size: 0.6rem;
    }
    
    .pwa-install-btn .pwa-btn-text {
        display: none;
    }
}

/* ============================================ */
/* ===== MEDIA QUERIES PRINCIPALES ===== */
/* ============================================ */

@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 580px;
        margin: 0 auto;
        min-height: auto;
        border-radius: 32px;
    }

    .login-left {
        min-height: auto;
        padding: clamp(25px, 4vh, 40px) clamp(20px, 4vw, 35px);
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        border-radius: 32px 32px 0 0;
    }

    .login-right {
        min-height: auto;
        padding: clamp(25px, 4vh, 40px) clamp(20px, 4vw, 35px);
        width: 100%;
        border-radius: 0 0 32px 32px;
    }

    .left-content {
        max-width: 100%;
        text-align: center;
    }

    .right-content {
        max-width: 100%;
    }

    .logo-section {
        justify-content: center;
    }

    .brand-title-section {
        text-align: center;
    }

    .title-underline {
        margin-left: auto;
        margin-right: auto;
    }

    .slogan-box {
        text-align: center;
    }

    .features-grid {
        justify-items: center;
    }

    .orb-1, .orb-2, .orb-3 {
        display: block;
    }

    .slogan-box i:first-child,
    .slogan-box i:last-child {
        display: block;
    }
}

@media (max-width: 850px) {
    .login-container {
        border-radius: 28px;
    }

    .login-left {
        border-radius: 28px 28px 0 0;
    }

    .login-right {
        border-radius: 0 0 28px 28px;
    }
}

@media (max-width: 550px) {
    body {
        padding: 0.5rem;
    }

    .login-container {
        border-radius: 24px;
    }

    .login-left {
        padding: clamp(16px, 2.5vh, 20px) clamp(12px, 2.5vw, 16px);
        border-radius: 24px 24px 0 0;
    }

    .login-right {
        padding: clamp(20px, 3vh, 28px) clamp(16px, 3vw, 22px);
        border-radius: 0 0 24px 24px;
    }

    .login-left {
        padding-bottom: clamp(16px, 2vh, 20px);
    }

    .logo-section {
        gap: clamp(10px, 2vw, 14px);
        margin-bottom: clamp(12px, 1.5vh, 16px);
    }

    .logo-main {
        width: clamp(38px, 6vw, 45px);
        height: clamp(38px, 6vw, 45px);
    }

    .brand-name {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    }

    .brand-version {
        font-size: clamp(0.5rem, 0.7vw, 0.6rem);
    }

    .main-title {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }

    .title-underline {
        width: clamp(40px, 8vw, 60px);
        height: 3px;
        margin-top: clamp(6px, 1vh, 10px);
    }

    @keyframes underlineExpand {
        0% { width: clamp(40px, 8vw, 60px); opacity: 0.5; }
        100% { width: clamp(80px, 15vw, 120px); opacity: 1; }
    }

    .slogan-box {
        padding: clamp(12px, 1.5vh, 16px);
        border-radius: clamp(12px, 1.5vw, 14px);
        margin: clamp(10px, 1.5vh, 16px) 0 clamp(14px, 2vh, 20px) 0;
    }

    .slogan-text {
        font-size: clamp(0.7rem, 1.2vw, 0.8rem);
        line-height: 1.6;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: clamp(6px, 1vw, 8px);
    }

    .feature-item {
        font-size: clamp(0.6rem, 0.8vw, 0.7rem);
        padding: clamp(5px, 0.8vh, 7px) clamp(6px, 1vw, 10px);
        border-radius: clamp(8px, 1vw, 10px);
    }

    .feature-item i {
        font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    }

    .input-field input {
        padding: clamp(13px, 2vh, 15px) clamp(40px, 5vw, 45px) clamp(13px, 2vh, 15px) clamp(40px, 5vw, 45px);
        font-size: clamp(0.95rem, 1.1vw, 1rem);
        border-radius: clamp(12px, 1.5vw, 14px);
    }

    .btn-login {
        padding: clamp(14px, 2vh, 16px) clamp(16px, 2.5vw, 20px);
        font-size: clamp(0.95rem, 1.1vw, 1rem);
        border-radius: clamp(14px, 1.8vw, 16px);
    }

    .social-btn {
        width: clamp(42px, 5vw, 48px);
        height: clamp(42px, 5vw, 48px);
        border-radius: clamp(12px, 1.5vw, 14px);
        font-size: clamp(1rem, 1.2vw, 1.1rem);
    }

    .card-header h3 {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }

    .card-header p {
        font-size: clamp(0.8rem, 1vw, 0.9rem);
    }

    .card-header {
        margin-bottom: clamp(18px, 2.5vh, 24px);
    }

    .login-form {
        gap: clamp(16px, 2.2vh, 20px);
    }

    .card-footer {
        margin-top: clamp(22px, 3.5vh, 28px);
        padding-top: clamp(18px, 2.5vh, 22px);
    }

    .divider {
        gap: clamp(10px, 1.5vw, 14px);
        margin-bottom: clamp(14px, 2vh, 18px);
    }

    .divider-text {
        font-size: clamp(0.65rem, 0.8vw, 0.7rem);
    }

    .social-section {
        gap: clamp(12px, 2vw, 16px);
        margin-bottom: clamp(14px, 2vh, 18px);
    }

    .secure-badge {
        font-size: clamp(0.65rem, 0.8vw, 0.7rem);
        gap: 6px;
    }

    .form-options {
        gap: 8px;
    }

    .checkbox-label {
        font-size: clamp(0.75rem, 0.9vw, 0.8rem);
        gap: 8px;
    }

    .custom-checkbox {
        width: clamp(18px, 2.2vw, 20px);
        height: clamp(18px, 2.2vw, 20px);
    }

    .welcome-badge {
        padding: clamp(4px, 0.6vh, 6px) clamp(10px, 1.5vw, 14px) clamp(4px, 0.6vh, 6px) clamp(8px, 1.2vw, 12px);
    }

    .welcome-badge i {
        font-size: clamp(0.8rem, 1vw, 0.9rem);
    }

    .welcome-badge span {
        font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    }

    .slogan-box i:first-child,
    .slogan-box i:last-child {
        display: none;
    }

    .slogan-text {
        padding: 0;
    }
}

@media (max-width: 380px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .feature-item {
        font-size: 0.55rem;
        padding: 4px 6px;
        gap: 4px;
    }

    .feature-item i {
        font-size: 0.65rem;
    }

    .brand-name {
        font-size: 1rem;
    }

    .main-title {
        font-size: 1rem;
    }

    .slogan-text {
        font-size: 0.65rem;
    }

    .social-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .card-header h3 {
        font-size: 1.1rem;
    }

    .input-field input {
        padding: 11px 32px 11px 32px;
        font-size: 0.85rem;
    }

    .btn-login {
        padding: 11px 14px;
        font-size: 0.85rem;
        gap: 8px;
    }

    .login-container {
        border-radius: 20px;
    }

    .login-left {
        border-radius: 20px 20px 0 0;
        padding: 12px;
    }

    .login-right {
        border-radius: 0 0 20px 20px;
        padding: 16px 12px;
    }
}

/* ============================================ */
/* ===== SOPORTE PARA SAFARI Y WEBKIT ===== */
/* ============================================ */

@supports (-webkit-backdrop-filter: blur(10px)) {
    .slogan-box {
        -webkit-backdrop-filter: blur(10px);
    }
    .pwa-install-btn {
        -webkit-backdrop-filter: blur(10px);
    }
    .pwa-modal-overlay {
        -webkit-backdrop-filter: blur(16px);
    }
}

/* ============================================ */
/* ===== MEJORAS PARA DISPOSITIVOS TÁCTILES ===== */
/* ============================================ */

@media (hover: none) and (pointer: coarse) {
    .btn-login:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(59, 130, 246, 0.25);
    }

    .btn-login:active {
        transform: scale(0.97);
    }

    .social-btn:hover {
        background: #f8fafc;
        color: #64748b;
        transform: none;
        box-shadow: none;
        border-color: #e2e8f0;
    }

    .social-btn:active {
        background: var(--social-color);
        color: white;
        transform: scale(0.95);
        border-color: transparent;
    }

    .feature-item:hover {
        background: rgba(255, 255, 255, 0.03);
        transform: none;
        box-shadow: none;
    }

    .feature-item:active {
        background: rgba(59, 130, 246, 0.1);
        transform: scale(0.98);
    }
}

/* ============================================ */
/* ===== PREVENIR ZOOM EN INPUTS EN iOS ===== */
/* ============================================ */

@supports (-webkit-touch-callout: none) {
    .input-field input {
        font-size: 16px !important;
    }
}

/* ============================================ */
/* ===== SOPORTE PARA PANTALLAS CON MUELLES ===== */
/* ============================================ */

@supports (padding: max(0px)) {
    .login-left, .login-right {
        padding-left: max(clamp(12px, 2.5vw, 20px), env(safe-area-inset-left));
        padding-right: max(clamp(12px, 2.5vw, 20px), env(safe-area-inset-right));
        padding-top: max(clamp(12px, 2.5vh, 20px), env(safe-area-inset-top));
        padding-bottom: max(clamp(12px, 2.5vh, 20px), env(safe-area-inset-bottom));
    }
}

/* ============================================ */
/* ===== ANIMACIONES SUAVES PARA MÓVILES ===== */
/* ============================================ */

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

/* ============================================ */
/* ===== SCROLLBAR ===== */
/* ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
}

::-webkit-scrollbar-thumb {
    background: #2c7da0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a5a7a;
}

/* ============================================ */
/* ===== OVERLAY DE ERROR ===== */
/* ============================================ */

.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: overlayFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 20px;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.error-modal {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 32px;
    padding: clamp(35px, 5vh, 50px) clamp(30px, 4vw, 50px);
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 50px 100px -12px rgba(0, 0, 0, 0.4), 0 20px 40px -8px rgba(0, 0, 0, 0.1);
    animation: modalBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.error-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #ef4444, #dc2626, #ef4444);
    background-size: 200% 100%;
    animation: errorGradient 2s ease-in-out infinite;
}

@keyframes errorGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes modalBounce {
    0% { opacity: 0; transform: scale(0.8) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.error-icon-wrapper {
    width: clamp(80px, 10vw, 100px);
    height: clamp(80px, 10vw, 100px);
    border-radius: 50%;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(20px, 3vh, 28px);
    position: relative;
}

.error-icon-wrapper .error-icon-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2), transparent 70%);
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.1; }
}

.error-icon-wrapper i {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    color: #dc2626;
    position: relative;
    z-index: 1;
}

.error-modal h3 {
    color: #0a1628;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.error-modal p {
    color: #64748b;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: clamp(20px, 3vh, 28px);
}

.error-modal .error-detail {
    display: inline-block;
    background: #f1f5f9;
    padding: 8px 20px;
    border-radius: 40px;
    color: #475569;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    font-weight: 500;
    margin-bottom: clamp(20px, 3vh, 28px);
}

.error-modal .error-detail i {
    color: #94a3b8;
    margin-right: 8px;
}

.error-modal .error-progress {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.error-modal .error-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    border-radius: 4px;
    animation: progressShrink 3s linear forwards;
}

@keyframes progressShrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================ */
/* ===== OVERLAY DE CARGA (LOADING) ===== */
/* ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: overlayFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 20px;
}

.loading-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 32px;
    padding: clamp(40px, 6vh, 55px) clamp(35px, 5vw, 55px);
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 50px 100px -12px rgba(0, 0, 0, 0.4), 0 20px 40px -8px rgba(0, 0, 0, 0.1);
    animation: modalBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.loading-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    background-size: 200% 100%;
    animation: loadingGradient 2s ease-in-out infinite;
}

@keyframes loadingGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.loading-spinner-container {
    width: clamp(100px, 12vw, 120px);
    height: clamp(100px, 12vw, 120px);
    margin: 0 auto clamp(24px, 3.5vh, 32px);
    position: relative;
}

.loading-spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #3b82f6;
    border-right-color: #60a5fa;
    animation: spinRing 1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.loading-spinner-ring:nth-child(2) {
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
    border-top-color: #60a5fa;
    border-bottom-color: #2563eb;
    animation-duration: 1.4s;
    animation-direction: reverse;
}

.loading-spinner-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    border-bottom-color: #3b82f6;
    border-left-color: #60a5fa;
    animation-duration: 0.8s;
}

@keyframes spinRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-icon-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(40px, 5vw, 50px);
    height: clamp(40px, 5vw, 50px);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.loading-icon-center i {
    color: white;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
}

.loading-card h3 {
    color: #0a1628;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.loading-card p {
    color: #64748b;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    margin-bottom: clamp(18px, 2.5vh, 24px);
}

.loading-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: progressFill 3s ease-in-out forwards, progressGradient 1.5s ease-in-out infinite;
    width: 0%;
}

@keyframes progressFill {
    0% { width: 0%; }
    20% { width: 15%; }
    50% { width: 45%; }
    75% { width: 75%; }
    100% { width: 100%; }
}

@keyframes progressGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; background: #3b82f6; }
}

/* ============================================ */
/* ===== RESPONSIVE PARA OVERLAYS ===== */
/* ============================================ */

@media (max-width: 550px) {
    .error-modal,
    .loading-card {
        padding: clamp(28px, 4vh, 35px) clamp(20px, 3vw, 28px);
        border-radius: 24px;
    }
    
    .error-icon-wrapper {
        width: clamp(60px, 10vw, 70px);
        height: clamp(60px, 10vw, 70px);
    }
    
    .error-icon-wrapper i {
        font-size: clamp(2rem, 4vw, 2.5rem);
    }
    
    .loading-spinner-container {
        width: clamp(75px, 12vw, 85px);
        height: clamp(75px, 12vw, 85px);
    }
    
    .loading-icon-center {
        width: clamp(32px, 5vw, 38px);
        height: clamp(32px, 5vw, 38px);
    }
    
    .loading-icon-center i {
        font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    }
}

@media (max-width: 380px) {
    .error-modal,
    .loading-card {
        padding: clamp(20px, 3vh, 28px) clamp(16px, 2vw, 20px);
        border-radius: 20px;
    }
    
    .error-icon-wrapper {
        width: 55px;
        height: 55px;
        margin-bottom: 16px;
    }
    
    .error-icon-wrapper i {
        font-size: 1.8rem;
    }
    
    .loading-spinner-container {
        width: 65px;
        height: 65px;
        margin-bottom: 18px;
    }
    
    .loading-icon-center {
        width: 28px;
        height: 28px;
    }
    
    .loading-icon-center i {
        font-size: 0.8rem;
    }
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .error-overlay,
    .loading-overlay {
        animation: none;
    }
    
    .error-modal,
    .loading-card {
        animation: none;
    }
    
    .loading-progress-fill {
        animation: none;
        width: 100%;
    }
    
    .error-progress-bar {
        animation: none;
        width: 100%;
    }
}