/* ============================================================
   Zaken News — Global Style
   Shared base styles for server, public, and auth.
   Side-specific overrides live in server.css / public.css / auth.css
   ============================================================ */

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

/* ── BASE ELEMENTS ──────────────────────────────────────────── */
a      { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img    { max-width: 100%; display: block; }


/* ── FORM ───────────────────────────────────────────────────── */
form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-label { display: block; font-size: 13px; font-weight: 500; }
.form-hint  { font-size: 12px; color: var(--text-muted); }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface, #fff);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring, rgba(0,0,0,.08));
}
textarea.form-control {
  resize: none;
  overflow: hidden;
  line-height: 1.42;
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}


/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary            { background: var(--accent); color: #fff; transition: .15s;}
.btn-primary:hover      { opacity: .7; }
.btn-secondary          { background: var(--bg); color: var(--text); border: 1px solid var(--border); transition: .15s; }
.btn-secondary:hover    { opacity: .7; }
.btn-success            { background: #16a34a; color: #fff; transition: .15s; }
.btn-success:hover      { opacity: .7; }
.btn-warning            { background: #d97706; color: #fff; transition: .15s; }
.btn-warning:hover      { opacity: .7; }
.btn-danger             { background: #dc2626; color: #fff; transition: .15s; }
.btn-danger:hover       { opacity: .7; }
.btn-ghost              { background: none; color: var(--text-muted); border: 1px solid var(--border); transition: .15s; }
.btn-ghost:hover        { color: var(--text-muted); background: var(--bg); opacity: .7; }
.btn-ghost-danger       { background: none; color: #dc2626; border: 1px solid var(--border); transition: .15s; }
.btn-ghost-danger:hover { color: #b91c1c; background: #fef2f2; border-color: #fca5a5; opacity: .7; }
.btn-sm                 { padding: 5px 10px; font-size: 12px; }
.btn-icon               { padding: 6px; border-radius: 6px; }


/* ── TOAST ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  pointer-events: all;
  min-width: 240px;
  max-width: 360px;
  animation: toast-in .2s ease;
}
.toast.toast-out { animation: toast-out .2s ease forwards; }
.toast-success { background: #166534; color: #fff; }
.toast-error   { background: #991b1b; color: #fff; }
.toast-info    { background: #1e40af; color: #fff; }
.toast-warning { background: #854d0e; color: #fff; }

@keyframes toast-in  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes toast-out { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(20px); } }


/* ── ALERT ──────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius, 6px);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fef9c3; color: #854d0e; border-color: #fef08a; }


/* ── UTILITIES ──────────────────────────────────────────────── */
.is-hidden  { display: none !important; }
.w-100      { width: 100%; }

/* Text */
.text-muted   { color: var(--text-muted); }
.text-accent  { color: var(--accent); }
.text-danger  { color: #dc2626; }
.text-success { color: #166534; }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.text-italic  { font-style: italic; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.nowrap       { white-space: nowrap; }

/* Flex */
.d-flex        { display: flex; flex-direction: row; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.align-center  { align-items: center; }
.align-start   { align-items: flex-start; }
.justify-end   { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.ml-auto       { margin-left: auto; }

/* Gap */
.gap-2  { gap: 2px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* Spacing */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0 !important; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* Font weight */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
