/* ===== CSS ESPECÍFICO PARA LOGIN FERROVIARIO ===== */
/* Solo estilos nuevos - No duplica los del CSS principal */

/* Prevenir overflow global */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Login Hero Section */
.login-hero {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.95)), 
                url('https://images.unsplash.com/photo-1544620347-c4fd4a3d5957?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 0 4rem;
    margin-top: 80px;
    color: white;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><circle cx="10" cy="10" r="1" fill="rgba(255,107,53,0.1)"/><circle cx="30" cy="5" r="1" fill="rgba(255,107,53,0.05)"/><circle cx="70" cy="15" r="1" fill="rgba(255,107,53,0.08)"/></svg>');
    animation: float 25s ease-in-out infinite;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    max-width: 1300px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

/* Security Sidebar */
.security-sidebar {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(229, 90, 43, 0.9));
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.security-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="railpattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><rect width="20" height="2" fill="rgba(255,255,255,0.1)"/><rect y="18" width="20" height="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23railpattern)"/></svg>');
    opacity: 0.3;
}

.security-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.railnet-logo {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    animation: trainMove 3s ease-in-out infinite;
}

.railnet-logo h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.railnet-logo p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
    color: white;
}

.security-features {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.security-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.security-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.security-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.security-text h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 700;
}

.security-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.5;
    color: white;
}

.trust-badges {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-icon {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.trust-badge span:last-child {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

/* Login Main */
.login-main {
    background: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 3rem;
}

.login-header h1 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.login-header p {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.status-dot.active {
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #10b981;
}

/* Login Form */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.2rem;
    z-index: 2;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 1.2rem 1rem 1.2rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
    color: #1f2937;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b35;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group input:focus + .input-validation,
.form-group input:valid + .input-validation {
    opacity: 1;
}

.form-group input:focus ~ .input-icon {
    color: #ff6b35;
}

.input-validation {
    position: absolute;
    right: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #9ca3af;
    transition: all 0.3s ease;
    z-index: 2;
    padding: 0.5rem;
    border-radius: 6px;
}

.toggle-password:hover {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

.error-message {
    display: block;
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.checkbox-wrapper input:checked + .checkmark {
    background: #ff6b35;
    border-color: #ff6b35;
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
}

.checkbox-text {
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
}

.forgot-password {
    color: #ff6b35;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #e55a2b;
    text-decoration: underline;
}

/* Login Button */
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
    padding: 1.3rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-btn::before {
    content: '';
    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.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    background: linear-gradient(135deg, #e55a2b, #cc4d24);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.btn-loader {
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Login Divider */
.login-divider {
    position: relative;
    text-align: center;
    margin: 2.5rem 0;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.login-divider span {
    background: white;
    padding: 0 1.5rem;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Alternative Actions */
.alternative-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.alt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #4b5563;
    background: #f9fafb;
}

.alt-btn:hover {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.05);
    color: #ff6b35;
    transform: translateY(-2px);
}

.alt-icon {
    font-size: 1.1rem;
}

/* Login Footer */
.login-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
}

.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(16, 185, 129, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-bottom: 1.5rem;
}

.notice-icon {
    font-size: 1.5rem;
    color: #10b981;
    flex-shrink: 0;
}

.notice-text p {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.notice-text strong {
    color: #10b981;
}

.help-links {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.help-links a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.help-links a:hover {
    color: #ff6b35;
}

.help-links span {
    color: #d1d5db;
}

/* Track Animation Background */
.track-animation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 1;
    overflow: hidden;
}

.train-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        #ff6b35 0px,
        #ff6b35 10px,
        transparent 10px,
        transparent 20px
    );
    opacity: 0.6;
}

.moving-train {
    position: absolute;
    bottom: 0;
    left: -50px;
    width: 40px;
    height: 4px;
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    animation: trainTravel 8s linear infinite;
    border-radius: 2px;
}

/* Animaciones */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes trainMove {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(5px);
    }
    75% {
        transform: translateX(-5px);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes trainTravel {
    0% {
        left: -50px;
    }
    100% {
        left: 100vw;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 600px;
    }
    
    .security-sidebar {
        order: 2;
        padding: 2rem;
    }
    
    .login-main {
        order: 1;
        padding: 2.5rem;
    }
    
    .security-features {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .security-item {
        flex: 1;
        min-width: 280px;
        padding: 1.2rem;
    }
    
    .trust-badges {
        flex-direction: row;
        gap: 0.8rem;
    }
    
    .trust-badge {
        flex: 1;
        padding: 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .login-hero {
        padding: 4rem 0 2rem;
        margin-top: 70px;
        min-height: auto;
    }
    
    .login-wrapper {
        margin: 0 1rem;
        border-radius: 20px;
    }
    
    .login-main {
        padding: 2rem;
    }
    
    .security-sidebar {
        padding: 2rem;
    }
    
    .login-header h1 {
        font-size: 2rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .alternative-actions {
        grid-template-columns: 1fr;
    }
    
    .help-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .security-features {
        flex-direction: column;
    }
    
    .security-item {
        min-width: auto;
    }
    
    .trust-badges {
        flex-direction: column;
    }
    
    .railnet-logo h3 {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        margin: 0 0.5rem;
    }
    
    .login-main,
    .security-sidebar {
        padding: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
    }
    
    .form-group input {
        padding: 1rem 0.8rem 1rem 2.5rem;
    }
    
    .input-icon {
        left: 0.8rem;
        font-size: 1rem;
    }
    
    .toggle-password {
        right: 0.8rem;
    }
    
    .login-btn {
        padding: 1.1rem 1.5rem;
    }
    
    .security-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .security-icon {
        margin: 0 auto;
    }
    
    .railnet-logo {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .moving-train,
    .logo-icon,
    .status-dot {
        animation: none;
    }
    
    .hero-overlay {
        animation: none;
    }
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
    .login-btn:active {
        transform: scale(0.98);
    }
    
    .alt-btn:active,
    .toggle-password:active {
        transform: scale(0.95);
    }
}