/* ============================================================
   CV Villas — Shared Styles
   Used by: index.html, villa.html, admin.html
   ============================================================ */

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

:root {
  --navy:       #1a2744;
  --navy-mid:   #2e4a8a;
  --gold:       #c9a96e;
  --gold-dark:  #b8935a;
  --text:       #1a1a2e;
  --text-mid:   #374151;
  --text-light: #6b7280;
  --text-pale:  #9ca3af;
  --border:     #e5e7eb;
  --border-mid: #d1d5db;
  --bg:         #f8f9fb;
  --white:      #ffffff;
  --red:        #ef4444;
  --green:      #059669;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-sm:  0 2px 12px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.14);
}

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }

/* ── Spinner ── */
.spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading state ── */
.loading-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-light);
}

/* ── Skeleton shimmer ── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .15s, background .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn--gold    { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); color: #fff; box-shadow: 0 4px 16px rgba(201,169,110,.3); }
.btn--navy    { background: var(--navy); color: #fff; }
.btn--outline { background: transparent; border: 1.5px solid var(--border-mid); color: var(--text-mid); }
.btn--outline:hover { border-color: var(--gold); color: var(--gold); opacity: 1; }
.btn--danger  { background: var(--red); color: #fff; }
.btn--sm      { padding: 7px 14px; font-size: 0.82rem; }
.btn--full    { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Form elements ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.field input,
.field select,
.field textarea {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}
.field input.error,
.field select.error,
.field textarea.error {
  border-color: var(--red);
}
.field .error-msg {
  font-size: 0.77rem;
  color: var(--red);
  font-weight: 500;
}
.field .hint {
  font-size: 0.77rem;
  color: var(--text-pale);
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge--gold  { background: var(--gold); color: #fff; }
.badge--navy  { background: var(--navy); color: #fff; }
.badge--green { background: #d1fae5; color: #065f46; }
.badge--red   { background: #fee2e2; color: #991b1b; }
.badge--grey  { background: #f3f4f6; color: var(--text-mid); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 13px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast--success { background: #059669; }
.toast--error   { background: var(--red); }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}
.page-btn {
  width: 40px; height: 40px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid);
  transition: border-color .15s, color .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info {
  font-size: 0.88rem;
  color: var(--text-light);
  font-weight: 500;
  min-width: 90px;
  text-align: center;
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,15,30,.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal-header h2 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #fff; }
.modal-close {
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.8);
  transition: background .15s;
}
.modal-close:hover { background: rgba(255,255,255,.2); }
.modal-body { padding: 26px; }

/* ── Responsive utilities ── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
