.access-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
  gap: 38px;
  align-items: center;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 0%, rgba(47, 128, 255, .14), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)),
    #0b0b0b;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .44);
}

.access-copy h2 {
  max-width: 760px;
}

.access-copy strong {
  color: var(--white);
}

.access-form {
  padding: 22px;
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
}

.access-form input {
  min-height: 56px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-error {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.access-form.is-invalid {
  animation: portalShake .28s ease both;
  border-color: rgba(255, 42, 31, .45);
}

.client-workspace {
  padding-top: 0;
}

.client-workspace[hidden] {
  display: none;
}

.client-workspace.is-open {
  animation: portalIn .42s ease both;
}

.client-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 42, 31, .12), rgba(47, 128, 255, .08)),
    #090909;
}

.client-hero p {
  font-size: 18px;
  font-weight: 800;
}

.client-status {
  min-width: 156px;
  padding: 16px;
  border: 1px solid rgba(245, 245, 240, .14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
}

.client-status span,
.delivery-overview span,
.delivery-overview small {
  display: block;
  color: rgba(245, 245, 240, .58);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-status strong {
  display: block;
  margin-top: 8px;
  color: var(--white);
  font-family: Oswald, Impact, sans-serif;
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
}

.delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 34px;
}

.portal-projects {
  margin: 0 0 52px;
}

.portal-projects-head {
  margin-top: 16px;
}

.portal-project-list {
  display: grid;
  gap: 14px;
}

.portal-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 128, 255, .08), transparent 14rem),
    rgba(255, 255, 255, .035);
}

.portal-project-card.is-active {
  border-color: rgba(47, 128, 255, .42);
  background:
    linear-gradient(90deg, rgba(47, 128, 255, .1), rgba(255, 42, 31, .045)),
    rgba(255, 255, 255, .04);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}

.portal-project-tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(47, 128, 255, .32);
  border-radius: var(--radius);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.portal-project-card h3 {
  margin: 0 0 8px;
  color: var(--white);
  font-family: Oswald, Impact, sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  line-height: .95;
  text-transform: uppercase;
}

.portal-project-card p {
  margin: 0;
  max-width: 680px;
  color: rgba(245, 245, 240, .62);
  font-size: 15px;
  font-weight: 800;
}

.portal-project-meta {
  min-width: 180px;
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.portal-project-meta span,
.portal-project-meta small,
.portal-project-meta a {
  color: rgba(245, 245, 240, .56);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-project-meta strong {
  font-family: Oswald, Impact, sans-serif;
  font-size: 28px;
  line-height: 1;
  text-transform: uppercase;
}

.portal-project-meta a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-project-delivery {
  margin: 58px 0;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 245, 240, .1);
}

.delivery-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 52px;
}

.delivery-overview article {
  padding: 22px;
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

.delivery-overview strong {
  display: block;
  margin: 10px 0 6px;
  color: var(--white);
  font-family: Oswald, Impact, sans-serif;
  font-size: 48px;
  line-height: .9;
  text-transform: uppercase;
}

.portal-section-head,
.delivery-notes {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(260px, .55fr);
  gap: 34px;
  align-items: end;
  margin: 54px 0 24px;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1fr;
  grid-auto-rows: 210px;
  gap: 14px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background: #0b0b0b;
  cursor: pointer;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item:first-child {
  grid-row: span 2;
}

.photo-item .watermark-overlay {
  border-radius: inherit;
}

.portal-video-grid {
  display: grid;
  gap: 18px;
}

.delivery-card {
  overflow: hidden;
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

.card-media.has-play {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(47, 128, 255, .22), transparent 14rem),
    linear-gradient(135deg, #181818, #080808);
  cursor: pointer;
}

.video-delivery-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .74fr);
  gap: 18px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.video-delivery-card .card-media {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  z-index: 1;
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

.video-delivery-card .card-body {
  position: relative;
  z-index: 2;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: grid;
  align-content: start;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 128, 255, .08), transparent 14rem),
    rgba(255, 255, 255, .04);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}

.play-button {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 50%;
  background: rgba(5, 5, 5, .72);
  backdrop-filter: blur(10px);
}

.video-delivery-card .play-button {
  z-index: 12;
}

.play-button::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
}

.delivery-notes {
  align-items: start;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid rgba(245, 245, 240, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .82);
}

.modal.open {
  display: flex;
}

.modal-panel {
  width: min(960px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #080808;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .72);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
}

.modal-close {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  color: var(--white);
  padding: 9px 11px;
  cursor: pointer;
}

.modal-video-wrap {
  position: relative;
}

.modal video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}

.modal-download {
  margin-left: auto;
  width: auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.photo-modal-panel {
  width: min(1080px, 100%);
}

.photo-modal-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(70vh, 720px);
  background: #000;
}

.photo-modal-media img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.photo-nav {
  position: absolute;
  top: 50%;
  z-index: 16;
  width: 46px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 245, 240, .22);
  border-radius: var(--radius);
  background: rgba(5, 5, 5, .68);
  color: var(--white);
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
}

.photo-nav:hover {
  background: rgba(47, 128, 255, .4);
}

.photo-nav:disabled {
  opacity: .28;
  cursor: not-allowed;
}

.photo-nav-prev {
  left: 16px;
}

.photo-nav-next {
  right: 16px;
}

/* Video card thumbnail */
.card-media img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.video-delivery-card .card-media img,
.video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-delivery-card .card-media img {
  z-index: 2;
  transition: opacity .25s ease;
}

.video-delivery-card .card-media img.is-missing {
  opacity: 0;
}

.video-thumb {
  display: block;
  z-index: 2;
  opacity: .08;
  background:
    radial-gradient(circle at 80% 20%, rgba(47, 128, 255, .22), transparent 14rem),
    linear-gradient(135deg, #1a1a1a, #080808);
  transition: opacity .35s ease, filter .35s ease;
}

.video-thumb.is-ready {
  opacity: .86;
}

.video-thumb-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, .16), rgba(5, 5, 5, .74)),
    radial-gradient(circle at 18% 18%, rgba(255, 42, 31, .26), transparent 16rem),
    radial-gradient(circle at 82% 26%, rgba(47, 128, 255, .38), transparent 17rem),
    linear-gradient(135deg, #222, #070707);
}

.video-thumb-fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .16;
}

.video-thumb-fallback span,
.video-thumb-fallback strong {
  position: relative;
  z-index: 1;
  display: block;
  text-transform: uppercase;
}

.video-thumb-fallback span {
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

.video-thumb-fallback strong {
  max-width: 520px;
  color: var(--white);
  font-family: Oswald, Impact, sans-serif;
  font-size: clamp(32px, 5vw, 64px);
  line-height: .92;
  letter-spacing: .01em;
}

.video-thumb-label {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 4;
  padding: 7px 10px;
  border: 1px solid rgba(245, 245, 240, .18);
  border-radius: var(--radius);
  background: rgba(5, 5, 5, .64);
  color: rgba(245, 245, 240, .72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.card-thumb-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #111 0%, #1c1c1c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(245, 245, 240, .22);
  border-radius: 50%;
  color: rgba(245, 245, 240, .5);
  font-size: 16px;
  padding-left: 3px;
}

.card-body h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.revision-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(245, 245, 240, .1);
}

.revision-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.revision-head strong,
.revision-head span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.revision-head span {
  color: var(--blue);
}

.revision-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.revision-list li {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(245, 245, 240, .1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
  color: rgba(245, 245, 240, .76);
  font-size: 13px;
}

.revision-list li.is-done {
  opacity: .58;
}

.revision-list li.is-done span {
  text-decoration: line-through;
}

.revision-list small {
  color: rgba(245, 245, 240, .45);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.revision-empty,
.revision-final {
  color: rgba(245, 245, 240, .5);
  font-size: 13px;
  font-weight: 800;
}

.revision-field {
  gap: 7px;
}

.revision-field span {
  color: rgba(245, 245, 240, .62);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.revision-field textarea {
  max-width: 100%;
  min-height: 92px;
}

.revision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border: 1px solid rgba(245, 245, 240, .16);
  border-radius: var(--radius);
  background: #111;
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .2s ease, transform .2s ease;
}

.portal-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes portalIn {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes portalShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

/* ─── Invoice status banner ──────────────────────────────────────────────── */

.invoice-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  border-width: 2px;
  border-style: solid;
}

.invoice-banner.is-paid {
  border-color: rgba(0, 214, 100, .45);
  background: rgba(0, 214, 100, .07);
}

.invoice-banner.is-unpaid {
  border-color: rgba(255, 42, 31, .55);
  background: rgba(255, 42, 31, .08);
}

.invoice-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
}

.invoice-banner.is-paid   .invoice-dot { background: #00d664; box-shadow: 0 0 8px rgba(0,214,100,.6); }
.invoice-banner.is-unpaid .invoice-dot { background: #ff2a1f; box-shadow: 0 0 8px rgba(255,42,31,.6); }

.invoice-banner-text {
  display: grid;
  gap: 4px;
}

.invoice-banner-text strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.invoice-banner.is-paid   .invoice-banner-text strong { color: #00d664; }
.invoice-banner.is-unpaid .invoice-banner-text strong { color: #ff2a1f; }

.invoice-banner-text span {
  color: rgba(245, 245, 240, .74);
  font-size: 14px;
  max-width: 680px;
}

.invoice-banner-text a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── Force all portal buttons to be readable ───────────────────────────── */

.client-workspace .btn,
.modal .btn {
  color: var(--white);
}

.client-workspace .btn-secondary,
.modal .btn-secondary {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(245, 245, 240, .28);
  color: var(--white);
}

.client-workspace .btn-secondary:hover,
.modal .btn-secondary:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(245, 245, 240, .45);
}

/* ─── Invoice block on portal ────────────────────────────────────────────── */

.portal-invoice-block {
  margin: 0 0 34px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(245, 245, 240, .14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

.portal-invoice-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.portal-invoice-inner h3 {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.portal-invoice-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Stat colors ────────────────────────────────────────────────────────── */

.stat-paid   { color: #00d664 !important; }
.stat-unpaid { color: var(--red) !important; }

/* ─── Watermark ──────────────────────────────────────────────────────────── */

.content-locked-wrap {
  position: relative;
}

.watermark-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  /* Stripe underlay */
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 38px,
    rgba(255, 42, 31, .055) 38px,
    rgba(255, 42, 31, .055) 40px
  );
}

.watermark-row {
  white-space: nowrap;
  color: rgba(245, 245, 240, .17);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  line-height: 3.4;
  transform: rotate(-38deg) scaleX(1.1);
  transform-origin: center center;
}

/* ─── Downloadable photos ────────────────────────────────────────────────── */

.photo-item.is-downloadable {
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease;
}

.photo-item.is-downloadable:hover {
  filter: brightness(1.1);
  transform: scale(1.01);
}

.photo-item.is-proof:hover img {
  filter: brightness(1.08);
}

/* ─── Save to Photos button inside delivery card ─────────────────────────── */

.btn-save {
  font-size: 12px;
  min-height: 36px;
  padding: 0 14px;
}

/* ─── Invoice lock tag ───────────────────────────────────────────────────── */

.invoice-lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 42, 31, .35);
  border-radius: var(--radius);
  color: rgba(255, 42, 31, .85);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.invoice-lock-tag::before {
  content: "🔒";
  font-size: 10px;
}

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

  .video-delivery-card .card-media {
    min-height: 240px;
  }
}

@media (max-width: 960px) {
  .access-shell,
  .client-hero,
  .delivery-overview,
  .portal-section-head,
  .delivery-notes,
  .portal-video-grid,
  .portal-project-card {
    grid-template-columns: 1fr;
  }

  .portal-project-meta {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }

  .photo-item:first-child {
    grid-row: auto;
  }

}
