@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --error-bg: rgba(239, 68, 68, 0.2);
    --error-text: #fca5a5;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    overflow-x: hidden;
}

/* Loader Styles */
#loader-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Card Design */
.card {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Elements */
h1 { margin-bottom: 10px; font-weight: 700; }
p { color: rgba(255,255,255,0.7); margin-bottom: 30px; }

.error-box {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-text);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: shake 0.4s ease;
}

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

input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
    transition: 0.3s;
}

input:focus {
    outline: none;
    border-color: white;
    background: rgba(0,0,0,0.3);
}

.btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* Selection Grid */
.grid {
    display: grid;
    gap: 12px;
    width: 100%;
}

.grid-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.grid-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(5px);
    border-color: white;
}

.grid-item i {
    font-size: 1.2rem;
    width: 35px;
    height: 35px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Viewport Iframe */
.view-wrapper { width: 100%; height: 100vh; position: relative; }
iframe { border: none; width: 100%; height: 100%; }
.back-fab {
    position: fixed; bottom: 20px; left: 20px;
    width: 50px; height: 50px; background: var(--primary);
    border-radius: 50%; display: flex; justify-content: center;
    align-items: center; color: white; text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 100;
}