/* assets/style.css — shared look for the authenticated part of AlpineHarbor.
 *
 * Direction: "a bit like Apple" — system font stack (not a serif/sans
 * pairing; Apple itself doesn't pair, it varies weight within one
 * grotesque), generous corner radii, quiet light-gray surfaces, restraint
 * over decoration. Brand color stays AlpineHarbor's own navy/teal from
 * the pitch deck and create_marina.php, not Apple's blue — the aesthetic
 * language is borrowed, the palette isn't.
 */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #d2d2d7;
  --accent: #0b3d5c;      /* navy — nav bars, headings */
  --accent-2: #1c7293;    /* teal — primary buttons, links */
  --accent-2-hover: #175f7c;
  --danger: #d6331c;
  --danger-bg: #fdecea;
  --success: #2e9e4f;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

p { color: var(--text-secondary); line-height: 1.5; }

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

/* --- Centered auth card (login) ----------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px;
}

.wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 28px;
  text-align: center;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}
.field input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(28, 114, 147, 0.18);
}

/* --- Berth popups (marina_edit.php + marina_view.php) -------------- */

.berth-popup { font-size: 13px; min-width: 220px; font-family: var(--font-sans); }
.berth-popup label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text); }
.berth-popup input,
.berth-popup select {
  width: 100%; box-sizing: border-box; padding: 6px 8px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  font-family: var(--font-sans); background: var(--surface); color: var(--text);
}
.berth-popup .dims { color: var(--text-secondary); font-size: 12px; margin-bottom: 8px; }
.berth-popup .actions { display: flex; gap: 8px; }
.berth-popup button {
  flex: 1; padding: 7px 8px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-family: var(--font-sans); font-weight: 600;
}
.berth-popup .save { background: var(--accent-2); color: #fff; }
.berth-popup .save:hover { background: var(--accent-2-hover); }
.berth-popup .cancel { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

.berth-popup .link-btn {
  background: none; border: none; color: var(--accent-2); font-size: 12.5px;
  font-weight: 600; padding: 4px 0; margin-bottom: 10px; cursor: pointer;
  text-align: left; display: block; flex: none;
}
.berth-popup .link-btn:hover { text-decoration: underline; }

.new-vessel-form {
  background: var(--bg); border-radius: 10px; padding: 10px 10px 2px; margin-bottom: 12px;
}
.new-vessel-form label { font-size: 12px; }
.new-vessel-form input { margin-bottom: 8px; padding: 5px 7px; font-size: 12.5px; }
.new-vessel-form .actions { margin-bottom: 8px; }
.new-vessel-form .actions button { font-size: 12.5px; padding: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-primary { background: var(--accent-2); color: #fff; }
.btn-primary:hover { background: var(--accent-2-hover); text-decoration: none; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { text-decoration: none; }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13.5px; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert-error { background: var(--danger-bg); color: var(--danger); }

.demo-accounts {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.demo-accounts summary { cursor: pointer; font-weight: 600; }
.demo-accounts table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.demo-accounts td { padding: 3px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* --- App shell (dashboard, marina_index) --------------------------- */

.topnav {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--accent);
  color: #fff;
}
.topnav .wordmark { margin: 0; color: #fff; font-size: 18px; }
.topnav .nav-right { display: flex; align-items: center; gap: 16px; font-size: 13.5px; }
.topnav .nav-right a { color: #cfe0ea; }
.topnav .role-badge {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.page { max-width: 960px; margin: 0 auto; padding: 40px 24px; }
.page h1 { font-size: 26px; }
.page .lede { margin-bottom: 32px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tile {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile.tile-link { cursor: pointer; }
.tile.tile-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.tile h3 { font-size: 17px; margin-bottom: 6px; }
.tile p { font-size: 13.5px; margin: 0; }
.tile.tile-disabled { opacity: 0.55; }
.tile .tile-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  margin-bottom: 10px;
}

/* --- Floating status cards over the marina_view.php map ------------ */

.status-stack {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 500;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}
.status-card h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.status-card .status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 5px 0;
}
.status-card .status-row + .status-row { border-top: 1px solid var(--border); }
.status-card .status-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 8px;
}
.status-card .status-empty { font-size: 13px; color: var(--text-secondary); }
.status-card .status-placeholder {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-style: italic;
}

.status-card.alert {
  background: rgba(224, 122, 31, 0.14);
  border: 1px solid rgba(224, 122, 31, 0.45);
}
.status-card.alert h4 { color: #b25a00; }
