/* Modern Login Page Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body {
    margin: 0;
    padding: 0 !important; /* Force override any padding from old common CSS */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
}

.modern-page-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    margin-top: 0 !important; /* Force override */
    padding-top: 0 !important; /* Force override */
}

/* Force hide any old empty header wrappers that might take up space on login pages */
.header, .header-v2, .top-header, .header-top, .index-header, .header-container-modern, .mobile-header-modern, .idcmaster-nav {
    display: none !important;
}

/* Top Navigation Bar */
.login-top-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through empty areas */
}

.login-top-nav > * {
    pointer-events: auto; /* Re-enable clicks on children */
}

.nav-brand {
    display: none; /* Hidden on desktop because left hero has it, shown on mobile */
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 20px;
    font-weight: 700;
}

.nav-brand img {
    height: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    padding: 8px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-left: auto;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-divider {
    width: 1px;
    height: 14px;
    background-color: var(--border-color);
}

/* Left Hero Section */
.modern-page-left {
    width: 50%;
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    color: white;
}

/* Animated Background */
.animated-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e3a8a 0%, #0f172a 100%);
}

/* Cloud Computing Security Animation */
.center-shield {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #60a5fa;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3), inset 0 0 40px rgba(59, 130, 246, 0.3);
    animation: pulseShield 4s ease-in-out infinite alternate;
}

.center-shield::before {
    content: '';
    position: absolute;
    inset: -20px;
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    animation: spinRotate 20s linear infinite;
}

.orbit-path {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.orbit-node {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.orbit-1 { width: 280px; height: 280px; animation: spinRotate 15s linear infinite; }
.orbit-2 { width: 420px; height: 420px; animation: spinRotateReverse 25s linear infinite; }
.orbit-3 { width: 560px; height: 560px; animation: spinRotate 35s linear infinite; }
.orbit-4 { width: 700px; height: 700px; animation: spinRotateReverse 45s linear infinite; }

/* Keep nodes upright while orbiting */
.orbit-1 .orbit-node { animation: spinRotateReverse 15s linear infinite; }
.orbit-2 .orbit-node { animation: spinRotate 25s linear infinite; }
.orbit-3 .orbit-node { animation: spinRotateReverse 35s linear infinite; }
.orbit-4 .orbit-node { animation: spinRotate 45s linear infinite; }

@keyframes pulseShield {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 30px rgba(59, 130, 246, 0.2), inset 0 0 30px rgba(59, 130, 246, 0.2); }
    100% { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 60px rgba(59, 130, 246, 0.5), inset 0 0 60px rgba(59, 130, 246, 0.5); }
}

@keyframes spinRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spinRotateReverse {
    0% { transform: translate(-50%, -50%) rotate(360deg); }
    100% { transform: translate(-50%, -50%) rotate(0deg); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

/* Left Content */
.modern-left-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 80px;
}

.brand-logo img {
    height: 48px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 16px;
    background: linear-gradient(to right, #fff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 500;
    color: #e2e8f0;
    margin: 0 0 24px;
}

.hero-desc {
    font-size: 16px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 48px;
    max-width: 500px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item i {
    color: #60a5fa;
}

/* Right Login Form Section */
.modern-page-right {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

.mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 30px;
}
.mobile-logo img { height: 40px; }

.login-header {
    margin-bottom: 40px;
}

.login-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.label-row label { margin-bottom: 0; }

.forgot-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 44px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-main);
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-wrapper input:focus + .input-icon {
    color: var(--primary-color);
}

.get-code-btn {
    white-space: nowrap;
    padding: 0 20px;
    height: 52px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.get-code-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eff6ff;
}

.get-code-btn:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: var(--border-color);
}

.input-toggle {
    position: absolute;
    right: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}
.input-toggle:hover { color: var(--text-main); }

.captcha-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-img-box {
    height: 52px;
    width: 140px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.captcha-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-submit-btn {
    width: 100%;
    height: 52px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 32px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.modern-submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.modern-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-arrow {
    transition: transform 0.3s ease;
}
.modern-submit-btn:hover:not(:disabled) .btn-arrow {
    transform: translateX(4px);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 15px;
}
.text-gray { color: var(--text-muted); }
.register-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.register-link:hover { text-decoration: underline; }

.legal-text {
    text-align: center;
    margin-top: 40px;
    font-size: 13px;
    color: #94a3b8;
}
.legal-text a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
}
.legal-text a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 992px) {
    .modern-page-left { display: none; }
    .modern-page-right { width: 100%; background: var(--bg-light); }
    .login-top-nav { padding: 20px; }
    .nav-brand { display: flex; }
    .login-card { 
        background: #fff; 
        border-radius: 24px; 
        box-shadow: 0 20px 40px rgba(0,0,0,0.05);
        padding: 40px 30px;
        margin-top: 60px;
    }
    .mobile-logo { display: none; }
}