/* ═══════════════════════════════════════════════════════════════════════════
   G2 LOGISTICS - BOOKINGS PAGE
   Matching Dashboard Design System
   ═══════════════════════════════════════════════════════════════════════════ */

/* Shared brand variables */
@import url('g2-variables.css');

/* ═══════════════════════════════════════════════════════════════════════════
   BASE LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background: var(--bg-primary);
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.5;
}

.app-layout {
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--g2-orange);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════ */
.dashboard-content {
  flex: 1;
  padding: 32px 48px;
  width: 100%;
}

@media (max-width: 768px) {
  .dashboard-content {
    padding: 20px 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD STYLING - Sharp Edges
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--g2-orange);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.card-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 4px 0 0 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEPPER DESIGN - Sharp, Industrial
   ═══════════════════════════════════════════════════════════════════════════ */
.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.stepper-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stepper-actions {
  display: flex;
  gap: 8px;
}

.stepper-action-btn {
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.stepper-action-btn:hover {
  border-color: var(--g2-orange);
  color: var(--g2-orange);
  background: var(--g2-orange-glow);
}

/* Stepper Steps */
.stepper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 20px;
  gap: 0;
  list-style: none;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  max-width: 160px;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(50% + 24px);
  width: calc(100% - 48px);
  height: 3px;
  background: var(--border-color);
  transition: background 0.3s ease;
}

.step.completed:not(:last-child)::after,
.step.active:not(:last-child)::after {
  background: var(--g2-orange);
}

.step-number {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 3px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.step.active .step-number {
  background: var(--g2-orange);
  color: white;
  border-color: var(--g2-orange);
  box-shadow: 0 4px 16px rgba(10, 132, 221, 0.4);
  transform: scale(1.1);
}

.step.completed .step-number {
  background: var(--g2-success);
  color: white;
  border-color: var(--g2-success);
}

.step.completed .step-number::after {
  content: '✓';
  font-size: 1.125rem;
}

.step.completed .step-number span {
  display: none;
}

.step-label {
  margin-top: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.3s ease;
}

.step.active .step-label {
  color: var(--g2-orange);
  font-weight: 700;
}

.step.completed .step-label {
  color: var(--g2-success);
}

@media (max-width: 640px) {
  .step-label {
    display: none;
  }
  .step-number {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }
  .stepper {
    padding: 20px 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM STYLING
   ═══════════════════════════════════════════════════════════════════════════ */
.step-panel {
  padding: 32px 28px;
  background: var(--bg-card);
}

@media (max-width: 640px) {
  .step-panel {
    padding: 24px 20px;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.required {
  color: var(--g2-error);
  font-weight: 700;
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: auto;
}

.form-input,
.form-select,
.form-textarea {
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s ease;
  width: 100%;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--g2-orange);
  box-shadow: 0 0 0 3px var(--g2-orange-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 44px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Toggle Switch */
.form-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.form-toggle input {
  display: none;
}

.toggle-track {
  width: 48px;
  height: 26px;
  background: var(--border-color);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.form-toggle input:checked + .toggle-track {
  background: var(--g2-orange);
}

.form-toggle input:checked + .toggle-track::after {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Form Info Box */
.form-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--g2-info);
}

.form-info svg {
  width: 20px;
  height: 20px;
  color: var(--g2-info);
  flex-shrink: 0;
  margin-top: 1px;
}

.form-info-text {
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOVEMENT TYPE TILES - Sharp Industrial Style
   ═══════════════════════════════════════════════════════════════════════════ */
.movement-tiles-container {
  margin-bottom: 24px;
}

.movement-tiles-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.movement-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .movement-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .movement-tiles {
    grid-template-columns: 1fr;
  }
}

.movement-tile {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 140px;
  overflow: hidden;
}

.movement-tile::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: background 0.2s ease;
}

.movement-tile:hover {
  border-color: var(--g2-orange);
}

.movement-tile.selected {
  border-color: var(--g2-orange);
  background: var(--g2-orange-glow);
}

.movement-tile.selected::before {
  background: var(--g2-orange);
}

.movement-tile-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.movement-tile-icon svg {
  width: 24px;
  height: 24px;
}

.movement-tile.selected .movement-tile-icon {
  background: var(--g2-orange);
  color: white;
}

.movement-tile-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.movement-tile-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.movement-tile-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: var(--g2-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.movement-tile.selected .movement-tile-check {
  opacity: 1;
  transform: scale(1);
}

.movement-tile-check svg {
  width: 12px;
  height: 12px;
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADDRESS CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.address-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .address-grid {
    grid-template-columns: 1fr;
  }
}

.address-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 24px;
  transition: all 0.2s ease;
}

.address-card:hover {
  border-color: var(--text-muted);
}

.address-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.address-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.address-card-icon.pickup {
  background: var(--g2-info);
}

.address-card-icon.dropoff {
  background: var(--g2-success);
}

.address-card-icon svg {
  color: white;
}

.address-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.address-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.address-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: var(--bg-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.address-tab:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.address-tab:hover {
  color: var(--text-primary);
}

.address-tab.active {
  background: var(--g2-orange);
  color: white;
}

.address-pane {
  display: none;
}

.address-pane.active {
  display: block;
}

.address-card .form-input,
.address-card .form-select {
  background: var(--bg-card);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS - Sharp Industrial
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--g2-orange);
  color: white;
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--g2-orange);
  color: var(--g2-orange);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

.btn-light {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-light:hover {
  background: var(--border-color);
}

.btn-white {
  background: white;
  color: var(--g2-orange);
  border: 2px solid var(--g2-orange);
}

.btn-white:hover {
  background: var(--g2-orange-glow);
}

/* Wizard Footer */
.wizard-footer {
  display: flex;
  align-items: center;
  padding: 20px 28px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.grow {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAP & QUOTE SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.map-container {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  position: relative;
}

#map, #quote-map {
  width: 100%;
  height: 300px;
}

.distance-info {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: var(--bg-card);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.distance-info svg {
  width: 18px;
  height: 18px;
  color: var(--g2-orange);
}

/* Quote Form */
.quote-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px;
}

@media (max-width: 640px) {
  .quote-form-grid {
    grid-template-columns: 1fr;
  }
}

.quote-results {
  display: none;
  padding: 28px;
  background: #1A1A18;
  color: white;
  margin: 0 28px 28px 28px;
}

.quote-results.visible {
  display: block;
}

.quote-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .quote-results-grid {
    grid-template-columns: 1fr;
  }
}

.quote-result-item {
  text-align: center;
}

.quote-result-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.quote-result-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--g2-orange);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION TABS
   ═══════════════════════════════════════════════════════════════════════════ */
/* Hidden by default - shown by JS for PAYG users who need the quote tab */
.section-tabs {
  display: none;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  width: fit-content;
}

.section-tab {
  padding: 12px 24px;
  border: none;
  background: var(--bg-card);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-tab:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.section-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.section-tab.active {
  background: var(--g2-orange);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   VEHICLE INFO CARD
   ═══════════════════════════════════════════════════════════════════════════ */
.vehicle-info-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 20px;
}

.vehicle-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.vehicle-info-icon {
  width: 40px;
  height: 40px;
  background: var(--g2-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vehicle-info-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.vehicle-info-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUMMARY CARD
   ═══════════════════════════════════════════════════════════════════════════ */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 20px;
}

.summary-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.summary-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.summary-section-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--g2-orange);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.summary-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRICE DISPLAY
   ═══════════════════════════════════════════════════════════════════════════ */
.price-display {
  background: #1A1A18;
  padding: 24px;
  text-align: center;
  margin: 20px 0;
}

.price-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.price-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--g2-orange);
}

.price-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUCCESS STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.success-panel {
  text-align: center;
  padding: 60px 40px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--g2-success);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.success-message {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.success-ref {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 16px 24px;
  display: inline-block;
  margin-bottom: 32px;
}

.success-ref-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.success-ref-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--g2-orange);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23B0B0B0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

[data-theme="dark"] .quote-results,
[data-theme="dark"] .price-display {
  background: #1A1A18;
}

[data-theme="dark"] .movement-tile.selected {
  background: rgba(10, 132, 221, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR ELEMENT OVERRIDES (scoped to .page-bookings for specificity)
   These override sidebar.css styles specifically for the bookings page.
   Uses .page-bookings body class to beat sidebar.css specificity.
   ═══════════════════════════════════════════════════════════════════════════ */

.page-bookings .main-content {
  display: flex;
  flex-direction: column;
}

/* Header bar and theme toggle use standard sidebar.css styles */
