/* css/root.css
   Theme variables, resets and small global utilities used across the app.
   Load this first on every page.
*/

:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --muted: #6b7280;
  --brand: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --text: #0b1220;
  --glass: rgba(2, 6, 23, 0.04);
}

/* Reset & base */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: inherit;
  text-decoration: none;
}

/* Accessible focus outline utility */
:focus {
  outline: 3px solid rgba(37, 99, 235, 0.12);
  outline-offset: 2px;
}

/* Small, reusable helpers */
.hidden {
  display: none !important;
}
.container {
  margin-left: auto;
  margin-right: auto;
  padding: 12px;
}
.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(8, 12, 20, 0.06);
}

/* Generic buttons (base) */
.btn {
  background: var(--brand);
  color: white;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.secondary {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(37, 99, 235, 0.12);
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Alerts (global) */
.alert {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 600;
}
.alert.success {
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.08);
}
.alert.error {
  background: linear-gradient(180deg, #fff1f2, #fee2e2);
  color: #7f1d1d;
  border: 1px solid rgba(239, 68, 68, 0.06);
}

/* Toast base */
.toast {
  position: fixed;
  right: 14px;
  bottom: 20px;
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  z-index: 2500;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.2);
  font-weight: 700;
}
.toast[hidden] {
  display: none;
}

/* Modal base */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 18, 0.55);
  z-index: 3000;
  padding: 18px;
}
.modal[hidden] {
  display: none;
}

/* toast base */
.toast {
  position: fixed;
  right: 14px;
  bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.12);
  font-weight: 700;
  opacity: 1;
  transition: opacity 260ms ease, transform 260ms ease;
  transform: translateY(0);
  pointer-events: auto;
}

/* hide helper - only used if you explicitly set hidden attribute */
.toast[hidden] {
  display: none !important;
}

/* success / error colors */
.toast.success {
  background: linear-gradient(180deg, var(--success), #059669);
}
.toast.error {
  background: linear-gradient(180deg, var(--danger), #b91c1c);
}

/* slight entry animation (optional) */
.toast-enter {
  opacity: 0;
  transform: translateY(6px);
}

/* Responsive container utility sizes */
@media (min-width: 720px) {
  .container {
    max-width: 980px;
  }
}
