:root {
    --bg: #0b0c10;
    --surface: #13151c;
    --border: #1e2130;
    --border-bright: #2c3050;
    --accent: #5b6af5;
    --accent-dim: rgba(91,106,245,.15);
    --accent-glow: rgba(91,106,245,.35);
    --green: #22d3a5;
    --green-dim: rgba(34,211,165,.12);
    --red: #f55b6e;
    --red-dim: rgba(245,91,110,.12);
    --yellow: #f5c842;
    --text: #e8eaf5;
    --text-muted: #7a7f9a;
    --text-dim: #4a4f6a;
    --radius: 14px;
    --font: 'Syne', sans-serif;
    --mono: 'DM Mono', monospace;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

/* Background */
.bg-grid {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 40%, transparent 100%);
    opacity: 0.4;
}
.glow { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; filter: blur(80px); }
.glow-1 { width: 600px; height: 400px; background: rgba(91,106,245,.12); top: -100px; left: 50%; transform: translateX(-50%); }
.glow-2 { width: 400px; height: 300px; background: rgba(34,211,165,.07); bottom: 10%; right: 10%; }

/* Layout */
.wrapper {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 20px 100px;
    gap: 24px;
}

/* Header */
.header {
    display: flex; align-items: center; gap: 16px;
    animation: fadeUp .5s ease both;
}
.logo-mark {
    width: 56px; height: 56px;
    border-radius: 50%; overflow: hidden;
    border: 2px solid var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
    flex-shrink: 0;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800; color: var(--accent);
}
.logo-photo { width: 100%; height: 100%; object-fit: cover; }
.site-title { font-size: clamp(26px, 5vw, 34px); font-weight: 800; letter-spacing: -1px; }
.site-tag { font-family: var(--mono); font-size: 11px; color: var(--text-muted); letter-spacing: .05em; }

/* Card */
.card {
    width: 100%; max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex; flex-direction: column; gap: 20px;
    animation: fadeUp .5s .08s ease both;
}
.card-label {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px;
    color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Fields */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; color: var(--text-dim); pointer-events: none; display: flex; }
.field-input {
    width: 100%; padding: 11px 42px 11px 36px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text);
    font-family: var(--mono); font-size: 14px;
    outline: none; transition: border-color .2s, box-shadow .2s;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field-input::placeholder { color: var(--text-dim); }
.clear-btn, .toggle-pass {
    position: absolute; right: 12px;
    background: none; border: none; cursor: pointer;
    color: var(--text-dim); font-size: 16px; line-height: 1;
    padding: 4px; display: flex; transition: color .2s;
}
.toggle-pass { right: 36px; }
.clear-btn:hover, .toggle-pass:hover { color: var(--text); }
.hidden { display: none !important; }
.field-hint { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

/* Buttons */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 16px; border-radius: 10px;
    font-family: var(--font); font-size: 13px; font-weight: 700;
    cursor: pointer; border: none; transition: all .2s; position: relative; overflow: hidden;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 18px var(--accent-glow); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-bright); }
.btn-outline:hover:not(:disabled) { background: var(--border); border-color: var(--accent); color: var(--accent); }
.btn-full { grid-column: 1/-1; }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(245,91,110,.3); }
.btn-danger:hover:not(:disabled) { background: rgba(245,91,110,.25); }
.btn-green { background: var(--green); color: #0b0c10; box-shadow: 0 4px 18px rgba(34,211,165,.3); }
.btn-green:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }

/* Status */
.status-box {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 10px;
    background: var(--accent-dim); border: 1px solid rgba(91,106,245,.25);
    font-family: var(--mono); font-size: 12px; color: var(--accent);
}
.status-box.error { background: var(--red-dim); border-color: rgba(245,91,110,.25); color: var(--red); }
.status-box.success { background: var(--green-dim); border-color: rgba(34,211,165,.25); color: var(--green); }
.status-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(91,106,245,.3);
    border-top-color: var(--accent);
    animation: spin .7s linear infinite; flex-shrink: 0;
}
.status-box.error .status-spinner { border-color: rgba(245,91,110,.3); border-top-color: var(--red); }
.status-box.success .status-spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Task list */
.task-panel {
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column; gap: 12px;
    animation: fadeUp .4s ease both;
}
.task-panel-header {
    display: flex; align-items: center; justify-content: space-between;
}
.task-count {
    font-family: var(--mono); font-size: 12px; color: var(--text-muted);
}
.task-list { display: flex; flex-direction: column; gap: 6px; }
.task-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer; transition: all .15s;
}
.task-item:hover { border-color: var(--border-bright); }
.task-item.selected { border-color: var(--accent); background: var(--accent-dim); }
.task-item.done { border-color: rgba(34,211,165,.3); background: var(--green-dim); opacity: .7; }
.task-item.failed { border-color: rgba(245,91,110,.3); background: var(--red-dim); }
.task-checkbox {
    width: 18px; height: 18px; border-radius: 5px;
    border: 2px solid var(--border-bright); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.task-item.selected .task-checkbox { background: var(--accent); border-color: var(--accent); }
.task-item.done .task-checkbox { background: var(--green); border-color: var(--green); }
.task-item.failed .task-checkbox { background: var(--red); border-color: var(--red); }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.task-status { font-family: var(--mono); font-size: 10px; color: var(--text-dim); flex-shrink: 0; }
.task-item.done .task-status { color: var(--green); }
.task-item.failed .task-status { color: var(--red); }

/* Progress */
.progress-bar {
    height: 4px; background: var(--border);
    border-radius: 99px; overflow: hidden;
}
.progress-fill {
    height: 100%; background: var(--accent);
    border-radius: 99px; transition: width .3s ease;
}

/* Info strip */
.info-strip {
    display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
    animation: fadeUp .5s .16s ease both;
}
.info-item {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 11px; color: var(--text-dim);
}

/* Footer */
.footer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    display: flex; justify-content: center; align-items: center; gap: 20px;
    padding: 14px 20px;
    background: linear-gradient(transparent, var(--bg) 60%);
    font-family: var(--mono); font-size: 11px; color: var(--text-dim);
}
.footer-link {
    display: flex; align-items: center; gap: 5px;
    color: var(--text-dim); text-decoration: none; transition: color .2s;
}
.footer-link:hover { color: var(--accent); }

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.shake { animation: shake .4s ease !important; }
@keyframes shake {
    0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}
}

/* Saved accounts */
.accounts-bar {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: -4px;
}
.account-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 99px;
    background: var(--bg); border: 1px solid var(--border);
    font-family: var(--mono); font-size: 11px; cursor: pointer;
    transition: all .15s; color: var(--text-muted);
}
.account-chip:hover { border-color: var(--accent); color: var(--accent); }
.account-chip span { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.account-remove { color: var(--text-dim); padding: 0 0 0 4px; font-size: 13px; line-height: 1; }
.account-remove:hover { color: var(--red) !important; }

.select-all-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--text-muted); cursor: pointer;
    padding: 4px 0;
}
.select-all-row input { accent-color: var(--accent); }