@tailwind base;
@tailwind components;
@tailwind utilities;

/* ─────────────────────────────────────────────
   C-SIDE UI CORE STYLESHEET
   Shared across Login / Field / Dashboard / admin 
   Version: v1.0
   ───────────────────────────────────────────── */


/* ---------- ROOT SYSTEM ---------- */
:root {
  --bg: #020617;
  --panel: #0f172a;
  --panel-border: #1e293b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text: #f8fafc;
  --muted: #94a3b8;
  --danger: #dc2626;
  --success: #16a34a;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.6);
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

/* ---------- COMMON PANELS ---------- */
.card,
.panel,
.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
}

/* Frosted glass variant */
.glass {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 800;
}

/* ---------- INPUTS ---------- */
input,
textarea,
select {
  width: 100%;
  background: #020617;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
}

/* ---------- BUTTONS ---------- */
button {
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px;
  border-radius: var(--radius-lg);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

/* ---------- SIGNATURE PAD ---------- */
.sig-viewport {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.sig-viewport canvas {
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

/* ---------- MAP ---------- */
#map {
  border-bottom: 1px solid var(--panel-border);
}

/* ---------- SYSTEM LOG ---------- */
#sys-log {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: #000;
  color: #00ff00;
  font-family: monospace;
  font-size: 10px;
  padding: 4px 6px;
  z-index: 1000;
  pointer-events: none;
}

/* ---------- MODALS ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
}

/* ---------- UTILITIES ---------- */
.hidden { display: none !important; }
.center { display: flex; align-items: center; justify-content: center; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }

/* ---------- PWA / iOS FIXES ---------- */
@supports (-webkit-touch-callout: none) {
  body {
    height: -webkit-fill-available;
  }
}