@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    /* Colores del manual de marca */
    --wirbi-blue: #6422FF;
    --wirbi-red: #FF5032;
    --wirbi-cyan: #32FFFF;
    --wirbi-purple: #9600D7;
    --wirbi-pink: #C83C78;
    --wirbi-dark: #231F20;
    --wirbi-light: #F2F2F2;
    --wirbi-green: #00FF88;
    --wirbi-yellow: #FFB800;
    
    /* Gradientes del manual */
    --wirbi-gradient: linear-gradient(135deg, #6422FF 0%, #9600D7 25%, #C83C78 50%, #FF5032 100%);
    --wirbi-gradient-dark: linear-gradient(135deg, #3C1469 0%, #1E1E78 50%, #280028 100%);
    --wirbi-gradient-5: linear-gradient(135deg, #6422FF 0%, #320096 100%);
    --wirbi-gradient-6: linear-gradient(135deg, #C83C78 0%, #9600D7 100%);
    --wirbi-gradient-7: linear-gradient(135deg, #1E1E78 0%, #280028 100%);
    
    /* Sistema de espaciado consistente */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: var(--wirbi-dark);
    position: relative;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Malla Isométrica optimizada */
.wirbi-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--wirbi-gradient-7);
    z-index: 0;
}

.wirbi-mesh::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(30deg, transparent 49.5%, rgba(50,255,255,0.03) 49.5%, rgba(50,255,255,0.03) 50.5%, transparent 50.5%),
        linear-gradient(-30deg, transparent 49.5%, rgba(50,255,255,0.03) 49.5%, rgba(50,255,255,0.03) 50.5%, transparent 50.5%);
    background-size: 60px 60px;
    opacity: 0.5;
    animation: isometricPulse 12s ease-in-out infinite;
}

@keyframes isometricPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.3; }
}

/* BASE MOBILE FIRST - 0 to 767px */
.main-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.info-panel {
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    min-height: 40vh;
    background: rgba(0, 0, 0, 0.3);
}

.floating-symbols {
    display: none;
}

.info-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.pro-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 8px 16px;
    background: rgba(100, 34, 255, 0.2);
    border: 1px solid rgba(100, 34, 255, 0.3);
    border-radius: 100px;
    margin-bottom: var(--spacing-lg);
    animation: fadeInLeft 0.8s ease-out;
    font-size: 13px;
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.pro-dot {
    width: 6px;
    height: 6px;
    background: var(--wirbi-cyan);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.pro-text {
    color: var(--wirbi-cyan);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-title {
    font-size: clamp(36px, 7vw, 56px);
    font-weight: 800;
    color: white;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
    letter-spacing: -1px;
    animation: fadeInLeft 0.8s ease-out 0.2s both;
}

.info-title .gradient-text {
    background: var(--wirbi-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-xl);
    line-height: 1.5;
    animation: fadeInLeft 0.8s ease-out 0.4s both;
}

.capabilities-grid {
    display: none;
}

.login-panel {
    background: white;
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    flex: 1;
    min-height: 60vh;
}

.logo-section {
    margin-bottom: var(--spacing-xl);
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.wirbi-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.logo-symbol {
    width: 40px;
    height: 40px;
    will-change: transform;
    transition: transform 0.3s ease;
}

.logo-symbol:hover {
    transform: scale(1.05) rotate(-5deg);
}

.logo-text {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    color: var(--wirbi-dark);
    letter-spacing: -0.5px;
}

.logo-text .light {
    font-weight: 300;
    opacity: 0.7;
}

.pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--wirbi-gradient);
    border-radius: 100px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.welcome-text h2 {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 800;
    color: var(--wirbi-dark);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.welcome-text p {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.login-section {
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wirbi-dark);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.microsoft-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--wirbi-dark);
    border: 2px solid transparent;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    will-change: transform;
}

.microsoft-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--wirbi-gradient);
    opacity: 0.3;
    transition: left 0.5s;
}

.microsoft-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(35, 31, 32, 0.2);
}

.microsoft-btn:hover::before {
    left: 0;
}

.microsoft-btn:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s;
}

.microsoft-btn:focus {
    outline: none;
    border-color: var(--wirbi-blue);
    box-shadow: 0 0 0 3px rgba(100, 34, 255, 0.2);
}

.microsoft-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.security-info {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--wirbi-light);
    border-radius: 16px;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.security-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.security-icon {
    width: 28px;
    height: 28px;
    background: var(--wirbi-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.security-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--wirbi-dark);
}

.security-list {
    display: grid;
    gap: var(--spacing-sm);
}

.security-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.check-circle {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--wirbi-blue), var(--wirbi-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.login-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid #E0E0E0;
    animation: fadeIn 0.8s ease-out 0.8s both;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--wirbi-blue);
}

.version-info {
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* TABLET STYLES - 768px to 1199px */
@media (min-width: 768px) and (max-width: 1199px) {
    .main-wrapper {
        flex-direction: row;
    }

    .info-panel {
        flex: 1;
        min-height: 100vh;
        padding: var(--spacing-2xl);
        background: transparent;
    }

    .info-title {
        font-size: 48px;
    }

    .info-subtitle {
        font-size: 19px;
    }

    .pro-indicator {
        font-size: 15px;
        padding: 10px 20px;
    }

    .pro-dot {
        width: 8px;
        height: 8px;
    }

    .floating-symbols {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        opacity: 0.05;
        pointer-events: none;
    }

    .floating-symbol {
        position: absolute;
        width: 70px;
        height: 70px;
        animation: floatSymbol 30s infinite ease-in-out;
    }

    @keyframes floatSymbol {
        0%, 100% { transform: translateY(0) rotate(0deg); }
        25% { transform: translateY(-30px) rotate(90deg); }
        50% { transform: translateY(20px) rotate(180deg); }
        75% { transform: translateY(-10px) rotate(270deg); }
    }

    .floating-symbol:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
    .floating-symbol:nth-child(2) { top: 20%; right: 15%; animation-delay: 5s; }
    .floating-symbol:nth-child(3) { bottom: 30%; left: 20%; animation-delay: 10s; }
    .floating-symbol:nth-child(4) { bottom: 10%; right: 25%; animation-delay: 15s; }

    .capabilities-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-top: var(--spacing-xl);
    }

    .capability-card {
        padding: 22px;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(50, 255, 255, 0.1);
        border-radius: 18px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        animation: fadeInUp 0.8s ease-out forwards;
        opacity: 0;
    }

    .capability-card:nth-child(1) { animation-delay: 0.5s; }
    .capability-card:nth-child(2) { animation-delay: 0.6s; }
    .capability-card:nth-child(3) { animation-delay: 0.7s; }
    .capability-card:nth-child(4) { animation-delay: 0.8s; }

    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .capability-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(100, 34, 255, 0.3);
        transform: translateY(-5px);
    }

    .capability-icon {
        width: 42px;
        height: 42px;
        background: var(--wirbi-gradient);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: var(--spacing-md);
        font-size: 22px;
    }

    .capability-title {
        color: white;
        font-size: 17px;
        font-weight: 700;
        margin-bottom: var(--spacing-xs);
    }

    .capability-desc {
        color: rgba(255, 255, 255, 0.75);
        font-size: 14px;
        line-height: 1.6;
    }

    .login-panel {
        flex: 1;
        padding: var(--spacing-2xl);
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
    }

    .logo-symbol {
        width: 50px;
        height: 50px;
    }

    .logo-text {
        font-size: 38px;
    }

    .pro-badge {
        font-size: 13px;
        padding: 7px 16px;
    }

    .welcome-text h2 {
        font-size: 34px;
    }

    .welcome-text p {
        font-size: 18px;
    }

    .auth-label {
        font-size: 14px;
    }

    .microsoft-btn {
        font-size: 18px;
        padding: 20px 32px;
    }

    .security-title {
        font-size: 17px;
    }

    .security-item {
        font-size: 15px;
    }

    .security-info {
        padding: 28px;
    }

    .footer-links a {
        font-size: 15px;
    }

    .version-info {
        font-size: 13px;
    }
}

/* DESKTOP STYLES - 1200px and up */
@media (min-width: 1200px) {
    .main-wrapper {
        flex-direction: row;
    }

    .info-panel {
        flex: 1;
        min-height: 100vh;
        padding: var(--spacing-3xl);
        background: transparent;
    }

    .info-content {
        max-width: 700px;
    }

    .info-title {
        font-size: 56px;
    }

    .info-subtitle {
        font-size: 20px;
    }

    .pro-indicator {
        font-size: 14px;
        padding: 10px 20px;
    }

    .floating-symbols {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        opacity: 0.05;
        pointer-events: none;
    }

    .floating-symbol {
        position: absolute;
        width: 80px;
        height: 80px;
        animation: floatSymbol 30s infinite ease-in-out;
    }

    .floating-symbol:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
    .floating-symbol:nth-child(2) { top: 20%; right: 15%; animation-delay: 5s; }
    .floating-symbol:nth-child(3) { bottom: 30%; left: 20%; animation-delay: 10s; }
    .floating-symbol:nth-child(4) { bottom: 10%; right: 25%; animation-delay: 15s; }

    .capabilities-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
        margin-top: var(--spacing-2xl);
    }

    .capability-card {
        padding: var(--spacing-xl);
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(50, 255, 255, 0.1);
        border-radius: 20px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        animation: fadeInUp 0.8s ease-out forwards;
    }

    .capability-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(100, 34, 255, 0.3);
        transform: translateY(-5px);
    }

    .capability-icon {
        width: 46px;
        height: 46px;
        background: var(--wirbi-gradient);
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: var(--spacing-md);
        font-size: 24px;
    }

    .capability-title {
        color: white;
        font-size: 18px;
        font-weight: 700;
        margin-bottom: var(--spacing-sm);
    }

    .capability-desc {
        color: rgba(255, 255, 255, 0.75);
        font-size: 15px;
        line-height: 1.6;
    }

    .login-panel {
        max-width: 520px;
        padding: var(--spacing-3xl);
        box-shadow: -30px 0 100px rgba(0, 0, 0, 0.5);
    }

    .logo-symbol {
        width: 50px;
        height: 50px;
    }

    .logo-text {
        font-size: 42px;
    }

    .welcome-text h2 {
        font-size: 36px;
    }

    .welcome-text p {
        font-size: 18px;
    }

    .auth-label {
        font-size: 14px;
    }

    .microsoft-btn {
        font-size: 18px;
        padding: 20px 32px;
    }

    .security-title {
        font-size: 17px;
    }

    .security-item {
        font-size: 15px;
    }
}

/* Landscape móvil */
@media (max-height: 600px) and (orientation: landscape) {
    .info-panel {
        min-height: auto;
        padding: var(--spacing-lg);
    }

    .login-panel {
        padding: var(--spacing-lg);
    }

    .security-info {
        margin-top: var(--spacing-md);
        padding: var(--spacing-md);
    }
}

/* Accesibilidad - Reducir movimiento para usuarios sensibles */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .wirbi-mesh::before {
        animation: none;
    }

    .floating-symbol {
        animation: none;
    }
}

/* Mejora de contraste para textos con opacidad baja */
@media (prefers-contrast: high) {
    .info-subtitle {
        color: rgba(255, 255, 255, 0.9);
    }

    .capability-desc {
        color: rgba(255, 255, 255, 0.8);
    }

    .auth-label {
        opacity: 0.9;
    }
}

/* Loading overlay optimizado */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(20px);
    padding: var(--spacing-lg);
}

.loading-overlay.active {
    display: flex;
}

.loading-animation {
    width: 80px;
    height: 80px;
    position: relative;
}

.loading-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}

.loading-ring:nth-child(1) {
    border-top-color: var(--wirbi-blue);
    animation: spin 1.5s linear infinite;
}

.loading-ring:nth-child(2) {
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
    border-right-color: var(--wirbi-purple);
    animation: spin 1.2s linear infinite reverse;
}

.loading-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    border-bottom-color: var(--wirbi-pink);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: var(--spacing-lg);
    color: var(--wirbi-dark);
    font-size: 14px;
    font-weight: 600;
}

/* Messages optimizados */
.message {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    left: var(--spacing-lg);
    padding: var(--spacing-md);
    border-radius: 12px;
    font-size: 13px;
    display: none;
    animation: slideIn 0.4s ease-out;
    z-index: 3000;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.active {
    display: block;
}

.error-message {
    background: #FFF5F5;
    border: 1px solid #FFB8B8;
    color: #C41E3A;
}

.success-message {
    background: #F0FFF4;
    border: 1px solid #84E1A6;
    color: #00875A;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}