:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #172033;
  --muted: #61708a;
  --line: #d8e0ea;
  --accent: #5c76ff;
  --accent-dark: #4560f2;
  --shadow: 0 20px 45px rgba(18, 31, 53, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }

body.customer-body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(to bottom, #f8fafc, #eef3f8);
}

.btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-dark);
  font-weight: 700;
}

.status-text {
  color: var(--muted);
  min-height: 24px;
  margin-top: 12px;
}

.customer-page {
  min-height: 100vh;
  padding: 0;
}

.customer-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.customer-header,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.customer-header h1,
.panel-head h3 {
  margin: 10px 0 0;
  line-height: 1.06;
}

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

.customer-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.customer-card select,
.customer-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: inherit;
  margin-top: 12px;
}

.customer-card textarea {
  min-height: 120px;
  resize: vertical;
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: white;
}

.table-scroll {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}

.table th {
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 700;
}

.upload-helper-text {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.helper-empty {
  padding: 18px;
  color: var(--muted);
}

.customer-lifecycle-alert {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

.customer-lifecycle-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.customer-lifecycle-alert h3 {
  margin: 0;
  line-height: 1.08;
}

.customer-lifecycle-alert .status-text {
  margin-bottom: 0;
}

.current-plan-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  padding: 16px 18px;
  margin-top: 14px;
}

.current-plan-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted);
}

.current-plan-value {
  margin-top: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.customer-card select:disabled,
.customer-card textarea:disabled {
  background: #f5f7fb;
  color: var(--muted);
  cursor: not-allowed;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .customer-page {
    padding: 16px;
  }

  .customer-grid {
    grid-template-columns: 1fr;
  }

  .customer-header,
  .panel-head {
    flex-direction: column;
  }
}
.customer-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.customer-upload-field {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.customer-upload-field span {
  font-weight: 700;
  color: var(--text);
}

.customer-upload-field input {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: inherit;
}

@media (max-width: 760px) {
  .customer-upload-grid {
    grid-template-columns: 1fr;
  }
}
.customer-delivery-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.delivery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  box-shadow: var(--shadow);
  padding: 20px;
}

.delivery-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.delivery-code {
  font-weight: 800;
  color: var(--text);
}

.delivery-date {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.delivery-status {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.delivery-status-completed {
  background: rgba(15, 159, 111, 0.12);
  color: #0a7d57;
}

.delivery-status-in-progress {
  background: rgba(245, 158, 11, 0.14);
  color: #b56a00;
}

.delivery-media-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.delivery-media-links a {
  all: unset;
}

.delivery-media-links a.media-download-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(92,118,255,0.1);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.delivery-media-links a.media-download-link:hover {
  background: rgba(92,118,255,0.18);
}

.delivery-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.delivery-video-box {
  display: grid;
  gap: 12px;
}

.delivery-video-box video {
  width: 100%;
  border-radius: var(--radius-lg);
  background: #0f172a;
  border: 1px solid var(--line);
}

.delivery-pending {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: #eef2f7;
  color: var(--muted);
}

.full-width {
  width: 100%;
}

@media (max-width: 760px) {
  .delivery-card-head,
  .delivery-video-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
.customer-page {
  padding-top: 90px;
}
.customer-grid {
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.customer-card {
  position: relative;
  overflow: hidden;
}

.customer-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(92,118,255,0.12), transparent 40%);
  pointer-events: none;
}
.customer-card {
  transition: 0.3s ease;
}

.customer-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 28px 70px rgba(0,0,0,0.12);
}
/* ===============================
   INPUT INTELLIGENT FOCUS
=============================== */

.customer-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(92,118,255,0.15);
  transition: 0.25s ease;
}

.customer-card input {
  transition: 0.25s ease;
}
.customer-card:nth-child(3)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(92,118,255,0.08) 50%,
    transparent 100%
  );
  animation: scan 4s infinite linear;
  pointer-events: none;
}

@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.btn:active {
  transform: scale(0.97);
}
.customer-card:nth-child(3):hover::before {
  animation-duration: 1.5s;
  opacity: 1;
}
/* ===============================
   GUIDED ENTRY FOCUS
=============================== */

#authSection .customer-card:first-child {
  outline: 2px solid rgba(92,118,255,0.25);
  box-shadow: 0 0 0 6px rgba(92,118,255,0.06);
}

#authSection .customer-card:first-child:hover {
  outline-color: rgba(92,118,255,0.5);
}
/* ===============================
   DEPTH HIERARCHY
=============================== */

.customer-card {
  backdrop-filter: blur(6px);
}

.customer-card:nth-child(3) {
  transform: scale(1.02);
}
/* ===============================
   SYSTEM BREATH
=============================== */

@keyframes subtlePulse {
  0% { box-shadow: 0 0 0 0 rgba(92,118,255,0.08); }
  50% { box-shadow: 0 0 0 10px rgba(92,118,255,0.02); }
  100% { box-shadow: 0 0 0 0 rgba(92,118,255,0.08); }
}

#authSection {
  animation: subtlePulse 6s infinite;
}
/* ===============================
   APP SECTION ENTRY
=============================== */

#appSection {
  animation: fadeInApp 0.6s ease;
}

@keyframes fadeInApp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ===============================
   RECOMMENDED ACTION
=============================== */

.recommended-action {
  border-color: rgba(92,118,255,0.45);
  box-shadow:
    0 24px 70px rgba(92,118,255,0.16),
    0 0 0 6px rgba(92,118,255,0.06);
}

.recommended-action::before {
  content: "Recommended next step";
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(92,118,255,0.12);
  color: var(--accent-dark);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 2;
}
/* ===============================
   RECOMMENDED BUTTON
=============================== */

.recommended-button {
  position: relative;
  z-index: 1;
  box-shadow:
    0 18px 40px rgba(92,118,255,0.25),
    0 0 0 4px rgba(92,118,255,0.12);
  transform: scale(1.02);
}

.recommended-button::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: rgba(92,118,255,0.08);
  z-index: -1;
}
@keyframes recommendedPulse {
  0% {
    box-shadow:
      0 18px 40px rgba(92,118,255,0.25),
      0 0 0 0 rgba(92,118,255,0.15);
  }
  50% {
    box-shadow:
      0 18px 40px rgba(92,118,255,0.25),
      0 0 0 10px rgba(92,118,255,0.05);
  }
  100% {
    box-shadow:
      0 18px 40px rgba(92,118,255,0.25),
      0 0 0 0 rgba(92,118,255,0.15);
  }
}

.recommended-button {
  animation: recommendedPulse 2.8s infinite;
}
.media-download-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(92,118,255,0.1);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.media-download-link:hover {
  background: rgba(92,118,255,0.18);
}

/* ===============================
   CUSTOMER MOBILE STACK FIX
=============================== */

@media (max-width: 760px) {
  .customer-page {
    padding: 96px 14px 24px;
  }

  .customer-shell {
    width: 100%;
    max-width: 100%;
  }

  .customer-grid {
    grid-template-columns: 1fr !important;
    gap: 18px;
  }

  .customer-card {
    width: 100%;
    padding: 20px;
  }

  #authSection .customer-card:nth-child(3) {
    transform: none;
  }
}
/* ===============================
   CUSTOMER MOBILE BUTTON + LAYOUT FIX
=============================== */

@media (max-width: 760px) {
  .customer-card {
    padding: 18px;
  }

  .btn,
  .customer-card .btn,
  .delivery-video-box .btn {
    width: 100%;
    min-height: 46px;
    height: auto;
    padding: 12px 14px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    font-size: 0.88rem;
  }

  .recommended-action::before {
    position: static;
    display: inline-flex;
    margin-bottom: 14px;
  }

  .delivery-card {
    padding: 16px;
  }

  .delivery-card-head {
    gap: 12px;
  }

  .delivery-status {
    width: fit-content;
  }

  .delivery-video-box {
    width: 100%;
  }

  .delivery-video-box video {
    max-width: 100%;
  }
}
/* ===============================
   CUSTOMER MOBILE NO HORIZONTAL OVERFLOW
=============================== */

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .customer-page,
  .customer-shell,
  .customer-card,
  .customer-grid,
  .delivery-card,
  .delivery-card-head,
  .delivery-video-grid,
  .delivery-video-box {
    max-width: 100%;
    min-width: 0;
  }

  .customer-card,
  .delivery-card {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .table {
    min-width: 0px;
  }

  .table-scroll {
    width: 100%;
    overflow-x: auto;
  }

  .delivery-card-head {
    align-items: stretch;
  }

  .delivery-status {
    white-space: normal;
  }
}
/* ===============================
   CUSTOMER UX MODAL
=============================== */

.customer-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.customer-modal-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.22);
  padding: 24px;
}

.customer-modal-card h3 {
  margin: 10px 0 0;
  line-height: 1.08;
}

.customer-modal-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.customer-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 760px) {
  .customer-modal-actions {
    flex-direction: column-reverse;
  }
}

/* ===============================
   CUSTOMER PREMIUM HUB
=============================== */

.customer-hub-nav {
  position: sticky;
  top: 86px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.customer-hub-tab {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: 0.22s ease;
}

.customer-hub-tab:hover,
.customer-hub-tab.is-active {
  color: var(--text);
  border-color: rgba(92, 118, 255, 0.38);
  background: rgba(92, 118, 255, 0.1);
  box-shadow: 0 10px 26px rgba(92, 118, 255, 0.12);
}

.customer-hub-panel {
  display: none;
}

.customer-hub-panel.is-active {
  display: block;
}

.customer-grid.customer-hub-panel.is-active {
  display: grid;
}

.customer-hub-panel.customer-card {
  width: 100%;
}

.customer-hub-panel .table-scroll,
.customer-hub-panel #customerOrders,
.customer-hub-panel #creditRequestsList {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
/* rende billing e richieste più leggibili quando ci sono molti record */
#customerOrders > div,
.customer-delivery-grid {
  display: grid;
  gap: 14px;
}

/* pannelli pubblici più morbidi */
.customer-hub-panel.customer-card {
  border-radius: 26px;
}

.customer-hub-panel.is-active {
  animation: customerPanelIn 0.28s ease both;
}

@keyframes customerPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .customer-hub-nav {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-hub-tab {
    width: 100%;
  }

  .customer-hub-panel .table-scroll,
  .customer-hub-panel #customerOrders,
  .customer-hub-panel #creditRequestsList {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
/* ===============================
   CUSTOMER HISTORY GROUPS
=============================== */

.customer-history-groups {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.customer-history-group {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  box-shadow: 0 16px 36px rgba(18, 31, 53, 0.06);
}

.customer-history-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
}

.customer-history-summary::-webkit-details-marker {
  display: none;
}

.customer-history-summary strong,
.customer-history-summary small {
  display: block;
}

.customer-history-summary small,
.customer-history-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.customer-history-meta {
  white-space: nowrap;
  font-weight: 700;
}

.customer-history-group[open] .customer-history-summary {
  border-bottom: 1px solid var(--line);
  background: rgba(92, 118, 255, 0.06);
}

.customer-history-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.customer-history-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.customer-history-group .customer-delivery-grid {
  padding: 16px;
  margin-top: 0;
}

@media (max-width: 760px) {
  .customer-history-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-history-meta {
    white-space: normal;
  }
}
.password-warning {
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #b56a00;
}

.password-warning.is-valid {
  color: #0a7d57;
}
.delivery-video-description {
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .delivery-video-description {
    margin-top: 12px;
  }
}

.delivery-video-description strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delivery-video-description p {
  margin: 0;
}
/* ===============================
   CUSTOMER DELIVERED VIDEOS FINAL DESKTOP LAYOUT
   Video 1 + Video 2 same size, stylist note on the right
=============================== */

.delivery-video-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.delivery-video-box {
  display: grid;
  gap: 12px;
  width: 100%;
}

.delivery-video-frame {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  background: #0f172a;
  border: 1px solid var(--line);
  overflow: hidden;
}

.delivery-video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #0f172a;
  object-fit: cover !important;
  object-position: center;
}

.delivery-video-box .btn {
  width: 100%;
}

@media (min-width: 900px) {
  .delivery-video-grid {
    grid-template-columns: 260px 260px minmax(240px, 1fr);
  }

  .delivery-video-description {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: start;
    width: 100%;
    max-width: 420px;
    margin-top: 0;
  }
}

@media (max-width: 899px) {
  .delivery-video-grid {
    grid-template-columns: 1fr;
  }

  .delivery-video-description {
    width: 100%;
    max-width: none;
    margin-top: 0;
  }
}

.delivery-video-frame video:fullscreen,
.delivery-video-frame video:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain !important;
  background: #000 !important;
}