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

:root {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --error: #ef4444;
  --radius: 12px;
}

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

/* ── Screens ── */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

/* ── Card ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

h1 { font-size: 1.8rem; font-weight: 700; text-align: center; }
h2 { font-size: 1.3rem; font-weight: 600; text-align: center; }
.subtitle { color: var(--text-muted); text-align: center; font-size: .95rem; }

/* ── Form ── */
.field { display: flex; flex-direction: column; gap: .4rem; }
label { font-size: .875rem; color: var(--text-muted); }

input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  padding: .65rem .9rem;
  outline: none;
  transition: border-color .2s;
}
input:focus { border-color: var(--accent); }

button[type="submit"], #exit-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: .75rem;
  transition: background .2s;
  width: 100%;
}
button[type="submit"]:hover, #exit-btn:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }

.error-msg {
  background: rgba(239,68,68,.1);
  border: 1px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-size: .875rem;
  padding: .6rem .9rem;
  text-align: center;
}
.hidden { display: none !important; }

/* ── Spinner ── */
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Simulation screen ── */
#screen-simulation {
  flex-direction: column;
  padding: 0;
  align-items: stretch;
  justify-content: flex-start;
}

#sim-topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1.2rem;
  flex-shrink: 0;
}

#sim-title { font-weight: 600; font-size: 1rem; }

#exit-btn {
  width: auto;
  padding: .4rem 1.2rem;
  font-size: .9rem;
}

#sim-frame {
  flex: 1;
  border: none;
  width: 100%;
  height: calc(100vh - 49px);
}
