* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; 
}

body {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    background: #061118; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    padding: 120px 20px 30px 20px; 
    overflow-y: auto; 
}

.mes-dashboard-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: #0b1e28;
    border-bottom: 2px solid #00f7ff33;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.mes-title {
    color: #00f7ff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mes-title i {
    font-size: 16px;
    animation: pulseGlow 2s infinite alternate;
}

.mes-system-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #ffffff;
    font-size: 13px;
    font-family: monospace;
}

.mes-time-block {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    padding-right: 20px;
    letter-spacing: 1px;
}

.mes-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mes-status.is-online {
    color: #00ff66;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
}

.mes-status.is-offline {
    color: #ff3366;
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: blinkStatus 1.5s infinite;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.mes-status.is-online .status-dot {
    background-color: #00ff66;
    box-shadow: 0 0 8px #00ff66;
}

.mes-status.is-offline .status-dot {
    background-color: #ff3366;
    box-shadow: 0 0 8px #ff3366;
}

#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: monospace;
    color: #00f7ff;
    padding: 20px;
    transition: opacity 0.8s ease;
}

.intro-terminal-box {
    width: 100%;
    max-width: 450px;
    text-align: left;
    margin-bottom: 30px;
    height: 120px;
}

.intro-brand {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #ffffff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.intro-log-line {
    font-size: 13px;
    line-height: 1.8;
    color: #00f7ffb3;
    display: none;
}

.intro-logo-atom-container {
    width: 150px;
    height: 150px;
    position: relative;
    opacity: 0;
    transform: scale(0.5);
    transition: all 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 20px;
}

.intro-logo-atom-container.visible {
    opacity: 1;
    transform: scale(1);
}

.intro-paintshop-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 6px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
    text-shadow: 0 0 15px rgba(0, 247, 255, 0.6);
}

.intro-paintshop-title.visible {
    opacity: 1;
    transform: translateY(0);
}

#atom-container {
    position: relative;
    width: 100%;
    max-width: 500px; 
    height: 38vh;      
    min-height: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 130px; 
    container-type: inline-size; 
    overflow: visible;
}

.nucleus {
    position: absolute;
    z-index: 10;
    text-align: center;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 75%; 
}

.nucleus h3 {
    color: #ffffff;
    font-size: clamp(22px, 7.5cqw, 36px); 
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    user-select: none;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 1),
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(0, 247, 255, 0.5);
}

.nucleus p {
    color: #ffffff;
    font-size: clamp(8px, 2.8cqw, 11px); 
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 4px; 
    opacity: 0.9;
    white-space: nowrap;
}

.atom-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 5;
    transform: scale(1.60); 
    transform-origin: center;
}

.orbit-trail {
    fill: none;
    stroke-width: 5; 
    stroke-linecap: round;
}

.orbit-group-1 { transform: translate(350px, 350px) rotate(0deg) scaleY(0.32); }
.orbit-trail-1 { stroke: url(#cyan-grad); filter: url(#glow-heavy-cyan); animation: rotateAtom 3s linear infinite; }

.orbit-group-2 { transform: translate(350px, 350px) rotate(78deg) scaleY(0.32); }
.orbit-trail-2 { stroke: url(#magenta-grad); filter: url(#glow-heavy-magenta); animation: rotateAtom 4s linear infinite; }

.orbit-group-3 { transform: translate(350px, 350px) rotate(-55deg) scaleY(0.32); }
.orbit-trail-3 { stroke: url(#gold-grad); filter: url(#glow-heavy-gold); animation: rotateAtom 2.6s linear infinite; }

.orbit-group-4 { transform: translate(350px, 350px) rotate(40deg) scaleY(0.32); }
.orbit-trail-4 { stroke: url(#blue-grad); filter: url(#glow-heavy-blue); animation: rotateAtom 3.5s linear infinite; }

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #061118fa;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.login-box {
    background: #0b1e28;
    padding: 30px;
    border-radius: 10px;
    width: 320px;
    text-align: center;
    border: 1px solid #00f7ff33;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.login-box h2 {
    color: #ffffff !important;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: #061118;
    border: 1px solid rgba(0,247,255,0.2);
    color: white;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
}

.password-container {
    position: relative;
    width: 100%;
}

.password-container input[type="password"] {
    padding-right: 42px !important;
}

.password-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 247, 255, 0.55);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}

.password-container i:hover {
    color: #00f7ff;
    text-shadow: 0 0 8px rgba(0, 247, 255, 0.6);
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #00f7ff;
    color: #061118;
    border: none;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 247, 255, 0.3);
}

#erroLogin {
    color: #ff3366;
    font-size: 13px;
    margin-top: 12px;
    font-weight: 500;
}

.button-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 16px;      
    z-index: 20;
    width: 100%;
    max-width: 940px;
    padding: 0 10px;
    margin-bottom: 30px;
}

.animated-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: clamp(11px, 1.8vh, 15px) 10px; 
    font-size: clamp(12px, 1.6vh, 14px);      
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 247, 255, 0.35);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    white-space: nowrap; 
}

.animated-button i {
    font-size: 14px;
    color: #00f7ff;
    transition: transform 0.3s ease;
}

.animated-button:hover {
    background: rgba(0, 247, 255, 0.15);
    border-color: #00f7ff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 247, 255, 0.4);
}

.animated-button:hover i {
    transform: scale(1.15);
}

footer {
    margin-top: auto; 
    padding-top: 20px;
    padding-bottom: 10px;
    color: rgba(255, 255, 255, 0.35);
    font-size: clamp(10px, 1.3vh, 12px);
    letter-spacing: 1.5px;
    text-align: center;
    z-index: 20;
    font-family: monospace;
}

@keyframes blinkStatus {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

@keyframes pulseGlow {
    0% { text-shadow: 0 0 4px #00f7ff; }
    100% { text-shadow: 0 0 12px #00f7ff, 0 0 20px #00f7ff; }
}

@keyframes rotateAtom {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@media (max-width: 768px) {
    body {
        justify-content: flex-start; 
        padding-top: 100px;
    }
    .mes-dashboard-header {
        padding: 8px 10px;
        height: auto; 
        min-height: 55px;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
    }
    .mes-system-info {
        gap: 12px;
        font-size: 11px;
        justify-content: center;
        width: 100%;
    }
    .mes-time-block {
        border-right: none;
        padding-right: 0;
    }
    .button-container {
        grid-template-columns: repeat(2, 1fr); 
        max-width: 460px;
        gap: 12px;
    }
    #atom-container {
        height: 32vh; 
        min-height: 200px;
        margin-bottom: 40px;
        max-width: 100%; 
    }
    .atom-svg {
        transform: scale(1.15);
    }
    .nucleus {
        width: 85%;
    }
}
