/* Client portal — extends wwf-pod-ui.css */

body.client-ui {
  background: #f4f6f9;
}

nav.client-nav {
  background: #1a3a5c;
}

.portal-card {
  max-width: 720px;
  margin: 0 auto 1rem;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.portal-table th,
.portal-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--wwf-border);
}

.portal-table th {
  font-weight: 600;
  color: var(--wwf-navy);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
}

fieldset {
  border: 1px solid var(--wwf-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

legend {
  font-weight: 700;
  color: var(--wwf-navy);
  padding: 0 0.35rem;
}

.req { color: #c62828; }

.status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-submitted,
.status-under_review { background: #fff3e0; color: #e65100; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }

.totp-steps {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
  color: var(--wwf-muted);
  font-size: 0.95rem;
}
.totp-steps li { margin: 0.35rem 0; }

.totp-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 1rem;
  margin: 0.5rem 0 1rem;
  background: #fff;
  border: 1px solid var(--wwf-border);
  border-radius: 8px;
  max-width: 280px;
}
.totp-qr-wrap svg {
  width: 220px;
  height: 220px;
  display: block;
}

.totp-manual {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.9rem;
}
.totp-manual summary {
  cursor: pointer;
  color: var(--wwf-navy-light);
  font-weight: 600;
}

.totp-secret {
  display: block;
  padding: 0.75rem;
  background: #f0f4f8;
  border-radius: 6px;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.btn-danger {
  background: #c62828;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.review-form label {
  display: block;
  margin-bottom: 0.65rem;
}

.review-form select,
.review-form input,
.review-form textarea {
  width: 100%;
  max-width: 420px;
}

.ok {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* --- Compact booking form --- */

.book-form-shell {
  max-width: 1100px;
  margin: 0 auto 1rem;
}

.book-form-head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.book-form-head .muted {
  margin: 0;
  font-size: 0.82rem;
}

.book-form-compact {
  font-size: 0.72rem;
}

.book-form-compact input,
.book-form-compact select,
.book-form-compact textarea,
.book-form-compact button {
  font-size: inherit;
}

.book-form-compact input:not([type="checkbox"]):not([type="radio"]),
.book-form-compact select {
  padding: 0.2rem 0.35rem;
  min-height: 1.65rem;
  border-radius: 4px;
  border: 1px solid var(--wwf-border);
  width: 100%;
}

.book-section {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid var(--wwf-border);
  border-radius: 8px;
}

.book-section--tight {
  padding: 0.55rem 0.65rem;
}

.book-section--hero {
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #f8fbff 0%, #eef4fc 55%, #f5f0ff 100%);
  border-color: #c5d4e8;
  box-shadow: 0 4px 24px rgba(26, 58, 92, 0.08);
}

.book-section h2 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  color: var(--wwf-navy);
}

.book-section .small {
  font-size: 0.68rem;
}

.field-inline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.field-inline--wide input {
  width: 100%;
}

.field-special input {
  width: 100%;
}

.direction-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.direction-opt {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--wwf-border);
  border-radius: 6px;
  cursor: pointer;
  background: #fafbfc;
}

.direction-opt:has(input:checked) {
  border-color: #1a6bb5;
  background: #e8f2fc;
}

.direction-opt span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.direction-opt em {
  font-style: normal;
  color: var(--wwf-muted);
  font-weight: 400;
  font-size: 0.65rem;
}

.book-addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.addr-block {
  border: none;
  padding: 0;
  margin: 0;
}

.addr-block legend {
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.micro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem 0.4rem;
}

.micro-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-weight: 600;
  font-size: 0.65rem;
}

.micro-grid .span-2 {
  grid-column: span 2;
}

.micro-grid--schedule {
  grid-template-columns: 1fr 0.7fr 0.7fr;
  margin-bottom: 0.45rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
}

.section-head .muted {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.72rem;
}

.btn-ghost {
  margin-left: auto;
  background: transparent;
  border: 1px dashed #1a6bb5;
  color: #1a6bb5;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
}

.booking-items-host {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.booking-item-card {
  background: #fff;
  border: 1px solid #d0dbe8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(26, 58, 92, 0.06);
}

.item-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.55rem;
  background: linear-gradient(90deg, #1a3a5c, #2a5a8c);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
}

.item-remove {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.item-card-body {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem 0.65rem;
}

.item-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem 0.4rem;
}

.item-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-weight: 600;
  font-size: 0.65rem;
}

.item-fields label:first-child {
  grid-column: span 2;
}

.box-viz-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  background: radial-gradient(ellipse at center, #fff 0%, #e8f0fa 100%);
  border-radius: 8px;
  border: 1px solid #c5d8ef;
  min-height: 140px;
}

.box-scene {
  perspective: 420px;
  width: 120px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.box-cube {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(32deg);
  transition: width 0.25s ease, height 0.25s ease;
}

.box-face {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(26, 90, 140, 0.35);
  background: linear-gradient(145deg, rgba(100, 170, 230, 0.55), rgba(40, 100, 170, 0.75));
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.35);
}

.box-face--front {
  width: 100%;
  height: 100%;
  transform: translateZ(calc(var(--depth, 28px) / 2));
}

.box-face--back {
  width: 100%;
  height: 100%;
  transform: rotateY(180deg) translateZ(calc(var(--depth, 28px) / 2));
}

.box-face--right {
  width: var(--depth, 28px);
  height: 100%;
  right: 0;
  transform-origin: right;
  transform: rotateY(-90deg);
  background: linear-gradient(145deg, rgba(60, 120, 190, 0.65), rgba(30, 80, 150, 0.85));
}

.box-face--left {
  width: var(--depth, 28px);
  height: 100%;
  left: 0;
  transform-origin: left;
  transform: rotateY(90deg);
  background: linear-gradient(145deg, rgba(70, 130, 200, 0.5), rgba(40, 90, 160, 0.7));
}

.box-face--top {
  width: 100%;
  height: var(--depth, 28px);
  top: 0;
  transform-origin: top;
  transform: rotateX(-90deg);
  background: linear-gradient(145deg, rgba(140, 190, 240, 0.7), rgba(80, 140, 210, 0.8));
}

.box-face--bottom {
  width: 100%;
  height: var(--depth, 28px);
  bottom: 0;
  transform-origin: bottom;
  transform: rotateX(90deg);
  background: linear-gradient(145deg, rgba(40, 90, 150, 0.6), rgba(20, 60, 110, 0.8));
}

.box-dims-readout {
  margin: 0.35rem 0 0;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--wwf-navy);
  letter-spacing: 0.02em;
}

.box-vol-readout {
  margin: 0.1rem 0 0;
  font-size: 0.62rem;
}

.carrier-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 0.65rem;
  align-items: start;
}

.carrier-prefs h2 {
  font-size: 0.82rem;
}

.courier-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.courier-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--wwf-border);
  border-radius: 999px;
  background: #fafbfc;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.65rem;
}

.courier-chip:has(input:checked) {
  background: #e3f0fb;
  border-color: #1a6bb5;
  color: #1a3a5c;
}

.courier-chip input {
  width: auto;
  margin: 0;
}

.carrier-suggest {
  padding: 0.45rem 0.55rem;
  background: linear-gradient(160deg, #1a3a5c, #2d6a9f);
  color: #fff;
  border-radius: 8px;
  text-align: center;
}

.carrier-suggest h3 {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.9;
}

.suggest-badge {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.carrier-suggest .muted {
  color: rgba(255, 255, 255, 0.75);
  margin: 0.35rem 0 0;
}

.book-submit {
  margin: 0.5rem 0 0;
  text-align: right;
}

.book-submit .btn-primary {
  font-size: 0.82rem;
  padding: 0.45rem 1.1rem;
}

.addr-block--locked {
  opacity: 0.92;
  background: #f8f9fb;
  pointer-events: none;
}

.addr-block--locked .micro-grid input,
.addr-block--locked .micro-grid select {
  background: #eef1f5;
}

.address-picker {
  margin-bottom: 0.65rem;
}

.addr-search-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--wwf-navy);
  margin-bottom: 0.25rem;
}

.book-form-g1 .book-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--wwf-border);
}

.book-form-g1 .book-section:last-of-type {
  border-bottom: none;
}

.book-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wwf-navy);
  letter-spacing: 0.01em;
}

.account-readonly {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.field-hint {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted, #5f6368);
  margin-top: 0.2rem;
}

.micro-grid--ref {
  grid-template-columns: 2fr 1fr;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.inline-del {
  display: inline;
  margin: 0;
}

.btn-ghost--danger {
  color: #c62828;
  font-size: 0.82rem;
  padding: 0.2rem 0.45rem;
}

.book-addresses .addr-block {
  margin-top: 0;
}

@media (max-width: 600px) {
  .micro-grid--ref {
    grid-template-columns: 1fr;
  }
  .book-section-title {
    font-size: 1rem;
  }
  .book-form-g1 input,
  .book-form-g1 select,
  .book-form-g1 button {
    font-size: 16px;
  }
  .book-submit {
    position: sticky;
    bottom: 0;
    background: #f4f6f9;
    padding: 0.75rem 0;
    margin: 0 -0.5rem;
    z-index: 2;
  }
}

@media (max-width: 900px) {
  .book-addresses,
  .carrier-row,
  .item-card-body {
    grid-template-columns: 1fr;
  }
  .direction-toggle {
    grid-template-columns: 1fr;
  }
  .micro-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .item-fields {
    grid-template-columns: repeat(2, 1fr);
  }
}