/* ==================== JARVIS LOGIN - IRON MAN THEME ==================== */

body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ==================== LOGIN CONTAINER ==================== */

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: radial-gradient(ellipse at center, rgba(0, 40, 60, 0.3) 0%, rgba(0, 0, 0, 0.95) 70%);
}

/* ==================== ARC REACTOR ==================== */

.login-arc-reactor {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

.reactor-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(0, 217, 255, 0.5);
}

.reactor-ring.outer {
    width: 120px;
    height: 120px;
    top: 0;
    left: 0;
    border-color: rgba(0, 217, 255, 0.2);
    border-top-color: rgba(0, 217, 255, 0.6);
    animation: reactor-spin 8s linear infinite;
}

.reactor-ring.middle {
    width: 80px;
    height: 80px;
    top: 20px;
    left: 20px;
    border-color: rgba(0, 217, 255, 0.3);
    border-bottom-color: rgba(0, 217, 255, 0.7);
    animation: reactor-spin 5s linear infinite reverse;
}

.reactor-ring.inner {
    width: 50px;
    height: 50px;
    top: 35px;
    left: 35px;
    border-color: rgba(0, 217, 255, 0.4);
    border-left-color: rgba(0, 217, 255, 0.8);
    animation: reactor-spin 3s linear infinite;
}

.reactor-core {
    position: absolute;
    width: 30px;
    height: 30px;
    top: 45px;
    left: 45px;
    border-radius: 50%;
    background: radial-gradient(circle, #00d9ff 0%, rgba(0, 217, 255, 0.3) 70%);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.5), 0 0 60px rgba(0, 217, 255, 0.2);
    animation: reactor-pulse 2s ease-in-out infinite;
}

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

@keyframes reactor-pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 217, 255, 0.5), 0 0 60px rgba(0, 217, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 217, 255, 0.7), 0 0 80px rgba(0, 217, 255, 0.3); }
}

/* ==================== TITLES ==================== */

.login-title {
    font-size: 2.5em;
    letter-spacing: 8px;
    color: #00d9ff;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    margin-bottom: 8px;
    font-weight: 300;
}

.login-subtitle {
    font-size: 0.8em;
    letter-spacing: 4px;
    color: rgba(0, 217, 255, 0.4);
    margin-bottom: 40px;
    font-weight: 300;
}

/* ==================== PIN INPUT ==================== */

.auth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pin-input-group {
    position: relative;
    margin-bottom: 10px;
}

.pin-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    font-size: 1.4em;
    letter-spacing: 8px;
    text-align: center;
    padding: 12px 20px;
    width: 280px;
    outline: none;
    font-family: 'Consolas', 'Courier New', monospace;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.pin-input:focus {
    border-bottom-color: #00d9ff;
    box-shadow: 0 2px 20px rgba(0, 217, 255, 0.15);
}

.pin-input::placeholder {
    color: rgba(0, 217, 255, 0.2);
    letter-spacing: 4px;
    font-size: 0.65em;
}

/* ==================== BUTTONS ==================== */

.login-btn {
    margin-top: 25px;
    padding: 12px 40px;
    width: 280px;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid rgba(0, 217, 255, 0.35);
    color: #00d9ff;
    font-size: 0.85em;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-align: center;
}

.login-btn:hover {
    background: rgba(0, 217, 255, 0.08);
    border-color: #00d9ff;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.15);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ==================== ERROR MESSAGE ==================== */

.login-error {
    color: #ff4444;
    font-size: 0.75em;
    letter-spacing: 2px;
    margin-top: 15px;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.login-error.hidden {
    display: none;
}

/* ==================== DIVIDER ==================== */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    width: 280px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgba(0, 217, 255, 0.15);
}

.divider-text {
    color: rgba(0, 217, 255, 0.3);
    font-size: 0.7em;
    letter-spacing: 3px;
}

/* ==================== FACE SCAN ==================== */

.face-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.face-scan-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s;
}

.face-scan-btn:hover {
    border-color: #00d9ff;
    background: rgba(0, 217, 255, 0.08);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.15);
}

.face-icon {
    width: 28px;
    height: 28px;
}

.face-scan-btn span {
    font-size: 0.5em;
    letter-spacing: 2px;
}

.face-status {
    color: rgba(0, 217, 255, 0.5);
    font-size: 0.7em;
    letter-spacing: 2px;
    margin-top: 10px;
    min-height: 16px;
}

/* ==================== WEBCAM ==================== */

.webcam-container {
    position: relative;
    width: 320px;
    height: 240px;
    border: 1px solid rgba(0, 217, 255, 0.3);
    overflow: hidden;
    margin-top: 10px;
}

.webcam-container.hidden {
    display: none;
}

.webcam-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.webcam-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.6), transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.webcam-status {
    position: absolute;
    bottom: 35px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #00d9ff;
    font-size: 0.7em;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 0;
}

.webcam-status.success {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.webcam-status.error {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.webcam-cancel-btn {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff6666;
    font-size: 0.6em;
    letter-spacing: 2px;
    padding: 3px 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.webcam-cancel-btn:hover {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

/* ==================== REGISTER SECTION ==================== */

.register-section {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.register-section.hidden {
    display: none;
}

.register-note {
    color: rgba(0, 217, 255, 0.3);
    font-size: 0.65em;
    letter-spacing: 2px;
}

.register-btn {
    background: transparent;
    border: 1px solid rgba(0, 217, 255, 0.2);
    color: rgba(0, 217, 255, 0.5);
    font-size: 0.7em;
    letter-spacing: 2px;
    padding: 6px 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.register-btn:hover {
    border-color: rgba(0, 217, 255, 0.5);
    color: #00d9ff;
}

/* ==================== MANAGE SECTION ==================== */

.manage-section {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.manage-section.hidden {
    display: none;
}

.manage-btn {
    background: transparent;
    border: 1px solid rgba(0, 217, 255, 0.2);
    color: rgba(0, 217, 255, 0.5);
    font-size: 0.6em;
    letter-spacing: 2px;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.manage-btn:hover {
    border-color: rgba(0, 217, 255, 0.5);
    color: #00d9ff;
}

.manage-btn.danger {
    border-color: rgba(255, 68, 68, 0.2);
    color: rgba(255, 68, 68, 0.5);
}

.manage-btn.danger:hover {
    border-color: rgba(255, 68, 68, 0.5);
    color: #ff4444;
}

/* ==================== FOOTER ==================== */

.login-footer {
    position: absolute;
    bottom: 30px;
    font-size: 0.6em;
    letter-spacing: 3px;
    color: rgba(0, 217, 255, 0.15);
}

/* ==================== ANIMATIONS ==================== */

.login-container.authenticated {
    animation: auth-success 0.8s ease forwards;
}

@keyframes auth-success {
    0% { opacity: 1; }
    50% { background: radial-gradient(ellipse at center, rgba(0, 217, 255, 0.15) 0%, rgba(0, 0, 0, 0.95) 70%); }
    100% { opacity: 0; transform: scale(1.02); }
}

.pin-input-group.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==================== MOBILE ==================== */

@media (max-width: 480px) {
    .login-title {
        font-size: 1.8em;
        letter-spacing: 5px;
    }

    .login-subtitle {
        font-size: 0.65em;
    }

    .pin-input {
        width: 220px;
        font-size: 1.2em;
    }

    .login-btn {
        width: 220px;
    }

    .webcam-container {
        width: 280px;
        height: 210px;
    }

    .login-arc-reactor {
        width: 90px;
        height: 90px;
    }

    .reactor-ring.outer { width: 90px; height: 90px; }
    .reactor-ring.middle { width: 60px; height: 60px; top: 15px; left: 15px; }
    .reactor-ring.inner { width: 38px; height: 38px; top: 26px; left: 26px; }
    .reactor-core { width: 22px; height: 22px; top: 34px; left: 34px; }
}
