/* Yup. — Base CSS */

:root {
  --primary: #1e3a5f;
  --primary-dark: #0f2340;
  --primary-light: #3a5a82;
  --accent: #c9a961;
  --accent-dark: #9d7f3d;
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1e293b;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e5e1d9;
  --success: #047857;
  --success-bg: #ecfdf5;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --warn: #a16207;
  --warn-bg: #fefce8;

  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-script: 'Great Vibes', 'Allura', cursive;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --shadow-sm: 0 1px 2px rgba(15, 35, 64, 0.04);
  --shadow: 0 4px 16px rgba(15, 35, 64, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 35, 64, 0.1);

  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;
}

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

html, body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 16px;
}

body { min-height: 100vh; }

img, svg { max-width: 100%; height: auto; display: block; }

button { font-family: inherit; cursor: pointer; border: 0; background: transparent; }
input, select, textarea { font-family: inherit; font-size: 16px; }
a { color: inherit; text-decoration: none; }

/* ========= Componentes base ========= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 15px;
  transition: all .2s ease;
  background: var(--primary);
  color: #fff;
  letter-spacing: 0.2px;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

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

.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(15, 35, 64, 0.04); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #7f1d1d; }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 17px; }
.btn-block { width: 100%; }

.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}
.textarea { resize: vertical; min-height: 80px; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.label .req { color: var(--danger); margin-left: 2px; }

.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .num { font-family: var(--font-display); font-size: 42px; font-weight: 600; line-height: 1; color: var(--primary); }
.stat-card .lbl { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: #f1f5f9; color: var(--ink-soft);
}
.chip-success { background: var(--success-bg); color: var(--success); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm); background: var(--ink);
  color: #fff; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: slide-in .3s ease; pointer-events: auto; min-width: 240px;
}
.toast-success { background: var(--success); }
.toast-danger { background: var(--danger); }
.toast-warn { background: var(--warn); }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fade-out { to { opacity: 0; transform: translateY(-8px); } }

/* Spinner */
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
  display: inline-block; vertical-align: middle;
}
.spinner-dark { border-color: rgba(30, 58, 95, 0.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 35, 64, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px; animation: fade-in .2s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 28px;
  max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
  animation: modal-in .3s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--primary); }
.modal-close { color: var(--ink-faint); padding: 4px 8px; border-radius: 6px; font-size: 20px; }
.modal-close:hover { background: #f1f5f9; color: var(--ink); }

/* Utils */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }

/* Loader tela cheia */
.fullscreen-loader {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; z-index: 10000; transition: opacity .4s;
}
.fullscreen-loader.fade { opacity: 0; pointer-events: none; }
.fullscreen-loader .wordmark {
  font-family: var(--font-display); font-size: 48px; font-weight: 600;
  color: var(--primary); letter-spacing: -1px;
}
