:root {
    --bg-dark: #121212;
    --card-bg: #1e1e1e;
    --primary: #EB5757;
    --primary-hover: #d94a4a;
    --danger: #cf3030;
    --danger-hover: #b02424;
    --secondary: #333;
    --secondary-hover: #444;
    --text-main: #f1f1f1;
    --text-muted: #a0a0a0;
    --border: #333;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

#app {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

header { text-align: center; margin-bottom: 30px; }
header .logo img { height: 40px; margin-bottom: 15px; display: block; margin-left: auto; margin-right: auto; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.025em; color: var(--text-main); }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 5px; }

.card {
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-left: 2px;
}

.input-group { margin-bottom: 5px; }

input[type="text"], 
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(235, 87, 87, 0.2); 
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.divider span {
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: transform 0.1s, background 0.2s;
    margin-top: 12px;
}
.btn:active { transform: scale(0.98); }

.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-hover); }

.secondary { background: var(--secondary); color: white; }
.secondary:hover { background: var(--secondary-hover); }

.danger { background: var(--danger); color: white; }
.danger:hover { background: var(--danger-hover); }

.error-banner {
    color: var(--danger);
    background: rgba(207, 48, 48, 0.1);
    border: 1px solid rgba(207, 48, 48, 0.3);
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

#result-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

#qrcode {
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease-out;
}

#qrcode img { display: block; }

.action-buttons {
    width: 100%;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.hidden { display: none !important; }

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (max-width: 600px) {
    #app { padding: 15px; }
    .card { padding: 20px; }
    input { font-size: 16px; }
}