:root { 
    --bg: #1a1c1e; 
    --card: #212529; 
    --text: #f8f9fa; 
    --input: #2c3034; 
    --border: #495057; 
    --error: #ff4d4d; 
}

[data-theme='light'] { 
    --bg: #e9ecef; 
    --card: #ffffff; 
    --text: #212529; 
    --input: #f8f9fa; 
    --border: #dee2e6; 
    --error: #d93025; 
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    transition: background-color 0.3s, color 0.3s; 
}

body { 
    background-color: var(--bg); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    overflow: hidden; 
}

.logo-container { 
    position: relative; 
    z-index: 10; 
    margin-bottom: -60px; 
}

.logo-img { 
    width: 120px; 
    height: 120px; 
    background: #000; 
    border-radius: 50%; 
    border: 7px solid var(--card); 
    object-fit: cover; 
    box-shadow: 0 12px 30px rgba(0,0,0,0.5); 
}

.login-card { 
    position: relative; 
    background: var(--card); 
    padding: 90px 60px 60px; 
    border-radius: 40px; 
    width: 95%; 
    max-width: 500px; 
    box-shadow: 0 25px 60px rgba(0,0,0,0.6); 
}

.theme-switch { 
    position: absolute; 
    top: 30px; 
    right: 35px; 
    background: none; 
    border: none; 
    cursor: pointer; 
    font-size: 24px; 
    opacity: 0.6; 
}

h2 { 
    text-align: center; 
    color: var(--text); 
    margin-bottom: 35px; 
    font-weight: 600; 
    font-size: 1.8rem; 
}

.input-wrapper { 
    position: relative; 
    width: 100%; 
    margin-bottom: 25px; 
}

input { 
    width: 100%; 
    padding: 18px 22px; 
    padding-right: 55px; 
    border-radius: 16px; 
    border: 1px solid var(--border); 
    background: var(--input); 
    color: var(--text); 
    outline: none; 
    font-size: 17px; 
}

.eye-icon { 
    position: absolute; 
    right: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    cursor: pointer; 
    background: none; 
    border: none; 
    color: var(--text); 
    opacity: 0.5; 
}

.btn { 
    width: 100%; 
    padding: 18px; 
    border: none; 
    border-radius: 50px; 
    font-weight: 700; 
    cursor: pointer; 
    color: white; 
    text-transform: uppercase; 
    font-size: 16px; 
    margin-top: 10px; 
}

.btn-on { background: #22c55e; }
.btn-off { background: #6c757d; opacity: 0.4; cursor: not-allowed; }

.error-popup {
    position: absolute;
    top: 50%; left: 50%; 
    transform: translate(-50%, -50%);
    background: var(--card); 
    color: var(--error);
    padding: 40px 60px; 
    border-radius: 4px; 
    z-index: 100;
    font-weight: 700; 
    text-align: center; 
    font-size: 1.3rem;
    box-shadow: 0 15px 50px rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease-out;
    white-space: nowrap;
    overflow: hidden;
}

.svg-top-line { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; 
    height: 6px; 
    pointer-events: none; 
    overflow: visible;
}

.error-line {
    fill: none;
    stroke: var(--error);
    stroke-width: 6;
    stroke-dasharray: 200;
    stroke-dashoffset: 0;
    animation: shrinkToSides 3s ease-in-out forwards;
}

@keyframes shrinkToSides { 
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 200; } 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translate(-50%, -60%); } 
    to { opacity: 1; transform: translate(-50%, -50%); } 
}

.fade-out { animation: fadeOut 0.5s ease-in forwards; }

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