/* === Shared Styles — Caufox === */

/* Transisi halus antar halaman (View Transitions API) + fallback fade */
@view-transition { navigation: auto; }
html { animation: cfade .22s ease; }
@keyframes cfade { from { opacity: .3 } to { opacity: 1 } }

:root {
  --bg: #111214;
  --panel: #191a1e;
  --panel-hover: #1f2026;
  --ink: #f1f1f2;
  --muted: #8b8c93;
  --line: #303137;
  --soft: #222329;
  --accent: #d97757;
  --accent-glow: rgba(217, 119, 87, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

/* Light mode */
[data-theme="light"] {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --panel-hover: #f0f0ed;
  --ink: #242320;
  --muted: #6b6863;
  --line: #e0ded8;
  --soft: #f0eee9;
  --accent: #c86849;
  --accent-glow: rgba(200, 104, 73, 0.12);
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* === Utility === */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #c86849;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover {
  background: var(--soft);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.btn-link:hover {
  text-decoration: underline;
}

/* === Form Fields === */
.field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field::placeholder {
  color: var(--muted);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 16px;
}
label:first-of-type {
  margin-top: 0;
}

.error {
  color: #f87171;
  font-size: 13px;
  margin-top: 6px;
  min-height: 20px;
}

/* === Layout helpers === */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* === Toasts === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toastIn 0.25s ease;
  max-width: 360px;
}
.toast.error { border-color: #f87171; background: #2d1b1b; }
.toast.success { border-color: #4ade80; background: #1b2d1f; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
