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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --accent: #6c63ff;
  --accent-hover: #574fd6;
  --text: #e8eaf0;
  --text-muted: #8b8fa8;
  --error: #ff5c7a;
  --success: #3ecf8e;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
}

.card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.card .subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* ── Form elements ── */
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"],
input[type="url"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: var(--accent);
}

input::placeholder {
  color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
  transition: background 0.15s, opacity 0.15s;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  padding: 0.4rem 0.875rem;
  width: auto;
  margin-top: 0;
}

.btn-ghost:hover { background: var(--border); color: var(--text); }

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.app-header h1 { margin-bottom: 0; }

/* ── Input row ── */
.input-group { margin-bottom: 1.25rem; }

/* ── Progress area ── */
#status-area { margin-top: 1.5rem; display: none; }

.status-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.progress-track {
  background: var(--bg);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.2s ease;
}

.progress-bar.indeterminate {
  width: 40%;
  animation: slide 1.2s ease-in-out infinite;
}

@keyframes slide {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(350%); }
}

/* ── Messages ── */
.msg {
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.msg-error { background: #2a1520; color: var(--error); border: 1px solid #4a1525; }
.msg-success { background: #0e2a1e; color: var(--success); border: 1px solid #1a4a35; }

/* ── Login ── */
.login-logo {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
