/* CrewSync.Ltd — Dark Navy, Electric Blue & Purple Visual System
   Faithfully aligned with homepage-updated.png, freelancer-dashboard.png, and company-subscription.png */

:root {
  --navy-950: #050816;
  --navy-900: #080e24;
  --navy-850: #0c1430;
  --navy-800: #111c40;
  --navy-700: #1a2854;
  --glass-bg: rgba(11, 18, 43, 0.78);
  --glass-bg-strong: rgba(9, 15, 36, 0.9);

  --blue-400: #38bdf8;
  --blue-500: #2998ff;
  --blue-600: #1d6ff2;
  --purple-400: #c084fc;
  --purple-500: #9333ea;
  --purple-600: #7c3aed;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --amber-400: #fbbf24;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-blue: rgba(41, 152, 255, 0.65);
  --border-purple: rgba(168, 85, 247, 0.65);
  --glow-blue: 0 0 28px rgba(41, 152, 255, 0.22), inset 0 0 24px rgba(41, 152, 255, 0.06);
  --glow-purple: 0 0 28px rgba(147, 51, 234, 0.25), inset 0 0 24px rgba(147, 51, 234, 0.08);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color-scheme: dark;
  background-color: var(--navy-950);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* Stage atmosphere background */
.stage-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 65% 55% at 15% 10%, rgba(29, 111, 242, 0.24), transparent 65%),
    radial-gradient(ellipse 65% 55% at 86% 14%, rgba(147, 51, 234, 0.28), transparent 65%),
    radial-gradient(ellipse 50% 45% at 50% 95%, rgba(56, 189, 248, 0.12), transparent 70%),
    linear-gradient(180deg, #040714 0%, #070d21 55%, #050816 100%);
}
.beam {
  position: absolute;
  top: -20%;
  width: 48vw;
  height: 90vh;
  filter: blur(75px);
  opacity: 0.22;
  pointer-events: none;
}
.beam-left {
  left: -10%;
  background: conic-gradient(from 135deg, #2998ff, transparent 55%);
}
.beam-right {
  right: -10%;
  background: conic-gradient(from 225deg, #a855f7, transparent 55%);
}
.stage-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 8, 22, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  mix-blend-mode: lighten;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.nav-link:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}
.nav-link.active {
  color: #fff;
  border-color: var(--border-purple);
  background: rgba(124, 58, 237, 0.16);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.25);
}
.auth-nav-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
}

/* Main */
.app-main {
  min-height: calc(100vh - 160px);
  padding: 36px 0 64px;
}

/* Typography & Gradients */
.hero-title {
  font-size: clamp(2.1rem, 4.8vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 14px;
}
.gradient-text {
  background: linear-gradient(90deg, #a855f7 0%, #60a5fa 55%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 24px;
}
.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.small { font-size: 0.86rem; }

/* Feature pill bar (matches homepage-updated.png) */
.feature-pill-bar {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  margin: 0 auto 36px;
  border-radius: var(--radius-pill);
  background: rgba(12, 20, 48, 0.78);
  border: 1px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.14);
  font-size: 0.92rem;
  color: var(--text-primary);
}
.feature-pill-bar .divider {
  color: rgba(148, 163, 184, 0.35);
}

/* Cards & Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.card-blue {
  border-color: var(--border-blue);
  box-shadow: var(--glow-blue);
}
.card-purple {
  border-color: var(--border-purple);
  box-shadow: var(--glow-purple);
}
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

/* Route cards on Homepage */
.route-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.route-card:hover {
  transform: translateY(-3px);
}
.route-card h2 {
  font-size: 1.85rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-primary);
  font-size: 0.98rem;
}
.check-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}
.check-dot.blue { background: var(--blue-500); color: #050816; }
.check-dot.purple { background: var(--purple-500); color: #fff; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  color: #fff;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-blue {
  background: linear-gradient(90deg, #38bdf8 0%, #2998ff 50%, #1d6ff2 100%);
  box-shadow: 0 6px 20px rgba(41, 152, 255, 0.35);
}
.btn-purple {
  background: linear-gradient(90deg, #a855f7 0%, #7c3aed 100%);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.38);
}
.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--blue-400);
  background: rgba(56, 189, 248, 0.1);
}
.btn-danger {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.5);
  color: #fda4af;
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.28);
}
.btn-sm { padding: 7px 14px; font-size: 0.84rem; }
.btn-full { width: 100%; }
.link-btn {
  background: none;
  border: none;
  color: var(--blue-400);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-green { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.45); }
.badge-blue { background: rgba(41, 152, 255, 0.18); color: #7dd3fc; border: 1px solid rgba(41, 152, 255, 0.45); }
.badge-purple { background: rgba(147, 51, 234, 0.22); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.48); }
.badge-amber { background: rgba(251, 191, 36, 0.16); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.42); }
.badge-rose { background: rgba(244, 63, 94, 0.16); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.45); }
.badge-slate { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(5, 9, 25, 0.85);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.93rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(41, 152, 255, 0.2);
}
textarea { min-height: 86px; resize: vertical; }

/* Skill chips */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 52, 0.72);
  color: var(--text-secondary);
  font-size: 0.83rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.skill-chip.selected {
  border-color: var(--blue-500);
  background: rgba(41, 152, 255, 0.2);
  color: #fff;
}

/* Profile completion bar */
.progress-wrap { min-width: 150px; }
.progress-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #38bdf8, #8b5cf6);
  transition: width 0.25s ease;
}

/* Availability Diary Calendar (matches freelancer-dashboard.png) */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 12px;
}
.calendar-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 25, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.swatch-available { background: rgba(16, 185, 129, 0.35); border: 1.5px solid #34d399; }
.swatch-unavailable { background: rgba(147, 51, 234, 0.35); border: 1.5px solid #a855f7; }
.swatch-unset { background: rgba(148, 163, 184, 0.12); border: 1.5px solid rgba(148, 163, 184, 0.4); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dow {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1.15 / 1;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 17, 42, 0.75);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  position: relative;
}
.cal-day:hover:not(:disabled) {
  transform: scale(1.04);
  border-color: var(--blue-400);
}
.cal-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.cal-day.status-available {
  background: rgba(16, 185, 129, 0.26);
  border-color: #34d399;
  color: #ecfdf5;
  box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.25);
}
.cal-day.status-unavailable {
  background: rgba(147, 51, 234, 0.32);
  border-color: #a855f7;
  color: #f3e8ff;
  box-shadow: inset 0 0 12px rgba(147, 51, 234, 0.28);
}
.cal-day.status-unset {
  background: rgba(15, 23, 52, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text-secondary);
}
.cal-day.pending-change::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-400);
}

/* Brush selector */
.brush-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.brush-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(8, 14, 36, 0.7);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.brush-btn.active {
  border-color: var(--purple-400);
  background: rgba(139, 92, 246, 0.24);
  color: #fff;
}

/* Search Bar & Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding-bottom: 12px;
}
.tab-btn {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(10, 16, 38, 0.7);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.28), rgba(41, 152, 255, 0.25));
  border-color: var(--border-purple);
  color: #fff;
}

.search-panel {
  border: 1px solid var(--border-blue);
  box-shadow: 0 0 28px rgba(41, 152, 255, 0.16);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  padding: 22px;
  margin-bottom: 24px;
}

/* Crew Result Cards */
.crew-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: rgba(10, 17, 42, 0.82);
  border: 1px solid rgba(41, 152, 255, 0.36);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.crew-card:hover {
  border-color: var(--blue-400);
  transform: translateY(-2px);
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2998ff, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(56, 189, 248, 0.55);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.rate-box {
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.rate-figure {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

/* Pricing cards */
.price-figure {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.alert-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(12, 20, 48, 0.82);
  margin-bottom: 18px;
}
.alert-lock {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(124, 58, 237, 0.12);
}
.alert-warn {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 6, 18, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  background: #0a112b;
  border: 1px solid var(--border-purple);
  box-shadow: var(--glow-purple);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding-bottom: 12px;
}
.modal-header h3 { margin: 0; font-size: 1.25rem; }
.icon-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.icon-close:hover { color: #fff; }

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #0e183b;
  border: 1px solid var(--border-blue);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.toast.error { border-color: var(--rose-500); background: #260d1c; }
.toast.success { border-color: var(--emerald-500); background: #092420; }

/* Footer */
.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(5, 8, 22, 0.9);
  padding: 26px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-links { display: flex; gap: 18px; align-items: center; font-size: 0.9rem; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

/* Spacing helpers */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 36px; }
.mb-2 { margin-bottom: 16px; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.space-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-4, .form-grid {
    grid-template-columns: 1fr;
  }
  .calendar-legend { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .brand-logo { height: 28px; }
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(7, 12, 30, 0.98);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px;
  }
  .main-nav.open { display: flex; }
  .auth-nav-slot { margin-left: 0; margin-top: 8px; }
}
