/* Shared look: theme variables, fonts, buttons, modals. */
:root {
  --primary: #1E4FD8;
  --secondary: #4CAF3D;
  --ink: #1b1f3b;
  --muted: #5b6285;
  --bg: #f4f7ff;
  --card: #ffffff;
  --line: #dfe5f5;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #f59e0b;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(27, 31, 59, .12), 0 12px 30px rgba(27, 31, 59, .10);
  --font: 'Fredoka', 'Baloo 2', ui-rounded, 'Segoe UI Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.1; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: .6em 1.2em; font-weight: 600; font-size: 1rem;
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .22);
  transition: transform .08s, box-shadow .08s, filter .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--secondary); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn.danger { background: var(--bad); }
.btn.good { background: var(--good); }
.btn.small { padding: .35em .85em; font-size: .9rem; }
.btn.big { font-size: 1.4rem; padding: .7em 1.6em; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

input[type=text], input[type=password], input[type=number], select, textarea {
  border: 2px solid var(--line); border-radius: 14px; padding: .55em .8em; background: #fff; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input[type=color] { width: 56px; height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 2px; background: #fff; cursor: pointer; }

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(15, 18, 40, .55); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade .15s ease-out;
}
.modal {
  background: #fff; color: var(--ink); border-radius: 26px; padding: 26px; max-width: 560px; width: 100%;
  max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  animation: pop .22s cubic-bezier(.2, 1.4, .5, 1);
}
.modal h2 { font-size: 1.6rem; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.modal.wide { max-width: 900px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; z-index: 2000;
  font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); animation: pop .2s; max-width: calc(100vw - 32px);
}
.toast.bad { background: var(--bad); }

@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: scale(.85); opacity: 0 } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg) } 50% { transform: translateY(-14px) rotate(4deg) } }
@keyframes drop {
  0% { transform: translateY(-60px) scale(.6); opacity: 0 }
  60% { transform: translateY(4px) scale(1.1); opacity: 1 }
  100% { transform: translateY(0) scale(1) }
}
@keyframes pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.05) } }
