/* Read-only demo mode. Loaded only when PERFUMZ_ENV=demo. */

.demo-mode-banner {
  --demo-ink: #14110c;
  --demo-cream: #f7f0e2;
  --demo-gold: #d3a75c;
  position: relative;
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .45rem .85rem;
  padding: .62rem clamp(1rem, 4vw, 2.4rem);
  border-bottom: 1px solid rgba(211, 167, 92, .48);
  background:
    radial-gradient(circle at 12% 50%, rgba(211, 167, 92, .16), transparent 30%),
    linear-gradient(120deg, #14110c 0%, #1c1710 52%, #14110c 100%);
  color: var(--demo-cream);
  font-family: 'Jost', sans-serif;
  font-size: .78rem;
  line-height: 1.45;
  text-align: center;
}

.demo-mode-banner strong {
  color: #fffaf0;
  font-weight: 600;
  letter-spacing: .01em;
}

.demo-mode-banner > span:not(.demo-mode-badge) {
  max-width: 62ch;
  color: rgba(247, 240, 226, .78);
}

.demo-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: .18rem .55rem;
  border: 1px solid rgba(211, 167, 92, .66);
  background: rgba(211, 167, 92, .14);
  color: var(--demo-gold);
  font-size: .59rem;
  font-weight: 600;
  letter-spacing: .17em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.demo-mode-banner a {
  color: var(--demo-gold);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  white-space: nowrap;
}

.demo-mode-banner a:hover,
.demo-mode-banner a:focus-visible {
  color: #f2d49a;
}

.demo-mode-banner a:focus-visible {
  outline: 2px solid var(--demo-gold);
  outline-offset: 3px;
}

/* Auto-dismissing client-side notice. */
.pfz-demo-toast {
  --demo-ink: #14110c;
  --demo-cream: #f7f0e2;
  --demo-gold: #d3a75c;
  position: fixed;
  right: clamp(.8rem, 2vw, 1.5rem);
  bottom: clamp(.8rem, 2vw, 1.5rem);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  width: min(30rem, calc(100vw - 1.6rem));
  padding: .95rem 1rem .95rem .95rem;
  border: 1px solid rgba(211, 167, 92, .7);
  border-radius: .35rem;
  background: #14110c;
  box-shadow: 0 1.2rem 3.8rem rgba(0, 0, 0, .38);
  color: var(--demo-cream);
  font-family: 'Jost', sans-serif;
  font-size: .84rem;
  line-height: 1.5;
  animation: pfz-demo-toast-in .28s cubic-bezier(.2, .8, .25, 1) both;
}

.pfz-demo-toast[hidden] {
  display: none;
}

.pfz-demo-toast__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  margin-top: .05rem;
  border: 1px solid rgba(211, 167, 92, .5);
  border-radius: 50%;
  color: var(--demo-gold);
}

.pfz-demo-toast__icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: .48rem;
  width: .62rem;
  height: .5rem;
  transform: translateX(-50%);
  border: 1.5px solid currentColor;
  border-radius: .12rem;
}

.pfz-demo-toast__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: .92rem;
  width: .4rem;
  height: .38rem;
  transform: translateX(-50%);
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: .4rem .4rem 0 0;
}

.pfz-demo-toast__body {
  min-width: 0;
  flex: 1 1 auto;
}

.pfz-demo-toast__body strong {
  display: block;
  margin-bottom: .12rem;
  color: #fffaf0;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pfz-demo-toast__body p {
  margin: 0;
  color: rgba(247, 240, 226, .8);
}

.pfz-demo-toast__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  margin: -.2rem -.2rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(247, 240, 226, .64);
  cursor: pointer;
}

.pfz-demo-toast__close:hover,
.pfz-demo-toast__close:focus-visible {
  background: rgba(247, 240, 226, .09);
  color: #fffaf0;
}

.pfz-demo-toast__close:focus-visible {
  outline: 2px solid var(--demo-gold);
  outline-offset: 2px;
}

.pfz-demo-toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  overflow: hidden;
  background: rgba(211, 167, 92, .16);
}

.pfz-demo-toast__progress::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: var(--demo-gold);
  transform-origin: left center;
  animation: pfz-demo-progress var(--pfz-demo-toast-life, 6s) linear forwards;
}

@keyframes pfz-demo-toast-in {
  from { opacity: 0; transform: translateY(.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pfz-demo-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Demo credential chooser on the shared account login page. */
.demo-access {
  margin: 1.4rem 0 1.2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius, 8px) * .8);
  background: var(--bg-2, var(--surface, #fbfaf6));
}

.demo-access__kicker {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--accent-ink, var(--accent));
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.demo-access__head h2 {
  margin: .35rem 0 .25rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.1;
}

.demo-access__head p {
  margin: 0 0 .85rem;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.5;
}

.demo-access__list {
  border-top: 1px solid var(--line);
}

.demo-access__row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .58rem 0;
  border-bottom: 1px solid var(--line);
}

.demo-access__copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: .08rem;
}

.demo-access__copy strong {
  color: var(--ink);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.demo-access__copy > span {
  color: var(--ink);
  font-size: .75rem;
  overflow-wrap: anywhere;
}

.demo-access__copy small {
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.35;
}

.demo-access__use {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: .3rem;
  min-height: 2rem;
  padding: .42rem .65rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-ink, var(--accent));
  font: inherit;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.demo-access__use:hover,
.demo-access__use:focus-visible {
  background: var(--accent);
  color: var(--accent-ink, #fff);
}

.demo-access__use:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.demo-access__password {
  margin: .75rem 0 0;
  color: var(--muted);
  font-size: .7rem;
}

.demo-access__password code {
  padding: .12rem .35rem;
  border: 1px solid var(--line);
  background: var(--surface, #fff);
  color: var(--ink);
  font-size: .7rem;
}

.demo-access__status {
  min-height: 1em;
  margin: .35rem 0 0;
  color: var(--accent-ink, var(--accent));
  font-size: .7rem;
}

@media (max-width: 460px) {
  .demo-access__row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .demo-access__use {
    margin-left: auto;
  }
}

/* Full-screen editors need the banner to take part in their flex layout. */
.studio-app > .demo-mode-banner {
  flex: 0 0 auto;
}

.studio-app:has(> .demo-mode-banner) .studio-frame iframe {
  height: calc(100vh - 62px - 38px - 2rem - 3.25rem);
}

.email-studio:has(> .demo-mode-banner) {
  display: flex;
  flex-direction: column;
}

.email-studio:has(> .demo-mode-banner) .email-editor-form {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

/* 403 page used when a client bypasses the UI interception. */
.demo-blocked {
  min-height: 62vh;
  display: grid;
  place-items: center;
  padding-block: clamp(4rem, 10vw, 8rem);
}

.demo-blocked__inner {
  max-width: 46rem;
  text-align: center;
}

.demo-blocked__badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .75rem;
  border: 1px solid var(--accent);
  color: var(--accent-ink, var(--accent));
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.demo-blocked h1 {
  margin: 1.1rem auto .8rem;
  max-width: 18ch;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1;
}

.demo-blocked p {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.7;
}

.demo-blocked__hint {
  margin-top: .8rem !important;
  font-size: .9rem;
}

.demo-blocked__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem;
  margin-top: 1.6rem;
}

@media (max-width: 700px) {
  .demo-mode-banner {
    align-items: flex-start;
    justify-content: flex-start;
    gap: .35rem .6rem;
    padding: .68rem .9rem;
    text-align: left;
    font-size: .74rem;
  }

  .demo-mode-banner > span:not(.demo-mode-badge) {
    flex-basis: 100%;
  }

  .demo-mode-banner a {
    white-space: normal;
  }

  .pfz-demo-toast {
    right: .6rem;
    bottom: .6rem;
    width: calc(100vw - 1.2rem);
  }

  .studio-app:has(> .demo-mode-banner) .studio-frame iframe {
    height: calc(100vh - 100px - 8rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pfz-demo-toast,
  .pfz-demo-toast__progress::after {
    animation: none;
  }
}
