:root {
    --bg: #0f172a; --bg-grad: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent: #38bdf8;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --danger: #f87171;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg), var(--bg-grad));
    color: var(--text-main);
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 1.5rem; overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(56,189,248,0.07) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
}

.panel {
    position: relative; z-index: 1;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 24px; padding: 2.5rem 2rem;
    width: 100%; max-width: 420px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.35);
    display: none; flex-direction: column; gap: 1.25rem;
}
.panel.active { display: flex; }

.panel-logo { display: flex; justify-content: center; }

.panel-title {
    font-size: 1.4rem; font-weight: 700; text-align: center;
}
.panel-subtitle {
    font-size: 0.85rem; color: var(--text-dim);
    text-align: center; margin-top: -0.5rem;
}

input[type="password"], select {
    width: 100%; padding: 0.85rem 1rem; border-radius: 12px;
    background: rgba(15,23,42,0.6); color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 1rem; font-family: 'Inter', sans-serif;
    outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none; appearance: none;
}
input[type="password"]:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
select option { background: #1e293b; color: white; }

.btn {
    width: 100%; padding: 0.9rem; border-radius: 14px; border: none;
    font-size: 1.05rem; font-weight: 700; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: opacity 0.18s ease, transform 0.15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #0f172a; }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.88; }

.btn-ghost {
    background: rgba(255,255,255,0.08); color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.14); }

.error-msg {
    font-size: 0.85rem; color: var(--danger);
    text-align: center; min-height: 1.1em;
}

.rec-indicator {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
}
.rec-dot {
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--danger);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.55; }
}
.rec-label { font-weight: 700; font-size: 1.05rem; color: var(--danger); }

.preview-box {
    background: rgba(15,23,42,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 1rem;
    max-height: 260px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 0.75rem;
    -webkit-overflow-scrolling: touch;
}
.preview-empty {
    color: var(--text-dim); font-size: 0.85rem;
    text-align: center; padding: 0.75rem 0;
}
.preview-entry {
    animation: slideUp 0.3s ease forwards; opacity: 0;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.preview-original {
    font-size: 0.75rem; color: var(--text-dim);
    font-style: italic; margin-bottom: 0.2rem;
}
.preview-translated {
    font-size: 0.92rem; color: var(--accent); font-weight: 600;
}

.back-link {
    position: relative; z-index: 1;
    margin-top: 1.5rem; color: var(--text-dim);
    font-size: 0.85rem; text-decoration: none; text-align: center;
}
.back-link:hover { color: var(--text-main); }

@media (max-width: 420px) {
    .panel { padding: 2rem 1.25rem; border-radius: 20px; }
    .panel-title { font-size: 1.2rem; }
}
.copyright { 
    position: fixed; 
    bottom: 0.9rem; 
    left: 0; 
    right: 0; 
    text-align: center; 
    font-size: 0.7rem; 
    color: var(--text-dim); 
    pointer-events: none; 
    z-index: 1; 
}
