/* ----------------------------------------------------
   Root variables
---------------------------------------------------- */
:root {
  --bg-main: #f7f9fc;
  --bg-light: #f0f4fa;

  --text-main: #1f2d3d;
  --text-muted: #555;

  --primary: #007bff;
  --primary-dark: #0056b3;
  --success: #28a745;

  --border-light: #e3e8ef;

  --shadow: 0 6px 16px rgba(0,0,0,0.07);
  --shadow-hover: 0 10px 22px rgba(0,0,0,0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 40px;

  --font-base: 1rem; /* 16px */
  --font-button: 1rem;
  --font-story: 1rem;
  --font-small: 0.95rem;
}

/* ----------------------------------------------------
   Global
---------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px; /* ensures rems scale properly */
}

body {
  font-family: system-ui, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  margin: 0;
}

.wrap {
  max-width: 960px;
  margin: var(--space-6) auto;
  padding: 0 var(--space-4);
}

h1 {
  font-size: 1.6rem;
  margin-bottom: var(--space-3);
}

p.instructions {
  font-size: var(--font-base);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

ul {
  margin: var(--space-2) 0 var(--space-3);
}

/* ----------------------------------------------------
   Buttons (Unified)
---------------------------------------------------- */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-button);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-light {
  background: var(--bg-light);
  color: var(--text-main);
}

.btn-light:hover {
  background: #dce3ed;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #1e7e34;
  transform: scale(1.05);
}

/* Navigation uses primary buttons */
.nav button {
  margin-right: var(--space-3);
  margin-bottom: var(--space-2);
  background: var(--primary);
  color: #fff;
}

.nav button:hover {
  background: var(--primary-dark);
}

/* ----------------------------------------------------
   Card & Items
---------------------------------------------------- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease; /* remove transform to avoid jump */
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.item {
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: #fcfdff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: background 0.2s ease;
}

.item:hover {
  background: #f1f5fb;
}

.sentence {
  margin-bottom: var(--space-1);
}

.inf {
  display: inline-block;
  font-family: monospace;
  color: #2b4b9c;
  background: #e9f1ff;
  border: 1px solid #cfe0ff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin: 0 6px;
  min-width: 50px;
  text-align: center;
  font-size: var(--font-small);
}

/* ----------------------------------------------------
   Inputs
---------------------------------------------------- */
input[type="text"] {
  min-width: 160px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-size: var(--font-base);
  font-weight: bold;
  color: var(--text-main);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 4px #007bff66;
}

.correctInput {
  background: #e6f4ea !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
  font-weight: bold;
  animation: correctPulse 0.4s ease forwards;
}

@keyframes correctPulse {
  0%   { transform: scale(1); opacity: .8; }
  50%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ----------------------------------------------------
   Controls
---------------------------------------------------- */
.controls {
  margin-top: var(--space-2);
}

.controls button {
  background: var(--bg-light);
  color: var(--text-main);
  border-radius: var(--radius-md);
}

.controls button:hover {
  background: #dce3ed;
}

/* Check button class for exercise 1 */
.buttons .check {
  background: var(--success);
  color: #fff;
}

/* ----------------------------------------------------
   Story style
---------------------------------------------------- */
.story {
  line-height: 1.8;
  font-size: var(--font-story);
}

.story input[type="text"] {
  margin: 0 3px;
  vertical-align: middle;
}

.story span {
  display: inline-block;
  margin-bottom: var(--space-3);
  vertical-align: middle;
}

/* ----------------------------------------------------
   Footer
---------------------------------------------------- */
footer {
  text-align: center;
  padding: var(--space-5) 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 50px;
  background: var(--bg-light);
  border-top: 1px solid var(--border-light);

  /* Soft drop shadow on all sides */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

  border-radius: var(--radius-md);
}

footer img {
  margin: 10px auto 0;
  max-width: 120px;
  height: auto;
  display: block;
}


