/* Shared styling for the quiz project - Industrial Dark Mode */
:root {
  --bg: #0f0f0f;
  --card: #1a1a1a;
  --muted: #7a7a7a;
  --border: #2a2a2a;
  --primary: #4a9eff;
  --primary-strong: #2e7dd9;
  --success: #4aaf5c;
  --success-strong: #3a9f4c;
  --danger: #ff5454;
  --danger-strong: #e63030;
  --warning: #ffb341;
}

* { box-sizing: border-box; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  color: #e8e8e8;
  line-height: 1.6;
  background-image: url('./icons/quizzer.png');
  background-size: 100px 100px;
  background-attachment: fixed;
  animation: scrollBackground 20s linear infinite;
}

@keyframes scrollBackground {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 100px 100px;
  }
}

a { color: inherit; }

a.btn { text-decoration: none; }

.page, .page-narrow {
  max-width: 55vw;
  min-width: 50vw;
  margin: 32px auto;
  padding: 24px;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-title { margin: 0; font-size: 28px; }

.page-subtitle { margin: 0; color: var(--muted); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.signup {
  background: #2f4f4f;
}

.btn:hover { background: var(--primary-strong); transform: translateY(-1px); }

.signup:hover { background: #1f3434 }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; background: var(--muted); }
.btn:disabled:hover { background: var(--muted); }

.btn-secondary {
  background: #2a4a6a;
  border-color: none;
}

.btn-secondary:hover { background: #3a5a7a; }

.btn-success {
  background: var(--success);
  border-color: none;
}

.btn-success:hover { background: var(--success-strong); }

.btn-danger {
  background: var(--danger);
  border-color: none;
}

.btn-danger:hover { background: var(--danger-strong); }

.btn-ghost {
  background: transparent;
  border-color: none;
  color: #e8e8e8;
}

.btn-ghost:hover { background: #2a2a2a; }

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: none;
  font: inherit;
  background: #4b4b4b;
  color: #e8e8e8;
}

label { font-weight: 600; }

form table { width: 100%; border-collapse: collapse; }

form td { padding: 10px 6px; vertical-align: middle; }

.table { width: 100%; border-collapse: collapse; margin-top: 12px; }

.table caption {
  text-align: left;
  font-weight: 700;
  margin-bottom: 8px;
}

.table th, .table td { padding: 12px; border: none; border-bottom: 1px solid var(--border); }

.table th { background: #1a1a1a; color: #4a9eff; text-align: left; }

.table tr:nth-child(even) td { background: #1a1a1a; }

.alert {
  padding: 12px 14px;
  border: none;
  border-left: 3px solid #7a7a7a;
  margin: 12px 0;
}

.alert-error { background: #2a1515; border-left-color: #ff5454; color: #ff7a7a; }

.alert-warning { background: #2a2415; border-left-color: #ffb341; color: #ffc854; }

.alert-success { background: #152a15; border-left-color: #4aaf5c; color: #6ac96e; }

.card {
  background: #252525;
  border: none;
  padding: 16px;
  margin-bottom: 16px;
}

.meta { color: var(--muted); font-size: 14px; }

.quiz-container { margin: 0 auto; }

.question-card {
  background-color: #252525;
  border: none;
  padding: 16px;
  margin-bottom: 20px;
}

.question-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.question-card-header h3 { margin: 0; }

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.answer-item { display: flex; gap: 10px; align-items: center; }

.answer-item input { margin: 0; flex: 1; }

.checkbox {
  display: flex;
  flex: .25;
}

.option { display: flex; gap: 10px; align-items: center; margin-bottom: 8px;}

.option label { flex: 1;}

.option input {
  flex: .2;
}

.message-stack { display: flex; flex-direction: column; gap: 8px; }

.muted { color: var(--muted); }

.password {
  -webkit-text-security: disc;
}

.password:active {
  -webkit-text-security: none;
}

h2 {
  margin: 0;
}

.input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}
.input-wrapper input {
  padding-right: 50px;
}
.char-count {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
  pointer-events: none;
  white-space: nowrap;
}