/* ===== Preview Banner ===== */
.preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #ffc107;
  color: #000;
  text-align: center;
  padding: 0.4rem 0;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  z-index: 10000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.preview-banner-text {
  display: inline-block;
}

.preview-banner-close {
  background: transparent;
  border: none;
  color: #000;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  opacity: 0.7;
}

.preview-banner-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.preview-banner-close:active {
  background-color: rgba(0, 0, 0, 0.2);
}

/* ===== User Bar and Quick Navigation ===== */
.user-info-bar {
  position: absolute;
  top: 1.2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.7em;
  background: rgba(250, 246, 255, 0.85);
  backdrop-filter: blur(4px);
  padding: 0.5em 1.2em 0.5em 0.7em;
  border-radius: 2em;
  box-shadow: 0 2px 16px rgba(130, 90, 220, 0.07);
  font-size: 0.98em;
  z-index: 200;
  transition: box-shadow 0.15s;
  opacity: 0;
  transform: translateY(-12px);
  animation: fadeSlideIn 0.48s cubic-bezier(.7,1.2,.42,1) forwards;
}

@keyframes fadeSlideIn {
  to { opacity: 1; transform: none; }
}

.quick-nav-shell {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin-right: 1.2em;
  position: relative;
}

.quick-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(160, 124, 255, 0.35);
  border-radius: 0.8em;
  background: #fff;
  color: #8b65ef;
  cursor: pointer;
  padding: 0;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.quick-nav-toggle:hover {
  background: #f3edff;
  border-color: rgba(130, 86, 227, 0.45);
}

.quick-nav-toggle:focus-visible {
  outline: 2px solid rgba(136, 88, 255, 0.45);
  outline-offset: 2px;
}

.quick-nav-toggle .bi {
  font-size: 1.2rem;
  line-height: 1;
}

.quick-nav {
  display: flex;
  gap: 1em;
}
.quick-nav a {
  color: #a07cff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.36em 0.85em;
  border-radius: 0.8em;
  font-size: 1em;
  transition: background 0.15s, color 0.14s;
}
.quick-nav a:hover,
.quick-nav a.active {
  background: #f3edff;
  color: #8256e3;
}

.account-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  border: 1px solid rgba(160, 124, 255, 0.25);
  background: rgba(255, 255, 255, 0.74);
  color: #7f68b0;
  border-radius: 1em;
  padding: 0.28em 0.62em;
  cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}

.account-toggle:hover {
  border-color: rgba(130, 86, 227, 0.4);
  background: rgba(255, 255, 255, 0.92);
}

.account-toggle:focus-visible {
  outline: 2px solid rgba(136, 88, 255, 0.45);
  outline-offset: 2px;
}

.user-avatar {
  font-size: 1.3em;
  color: #a07cff;
  display: flex;
  align-items: center;
}
.user-email {
  font-weight: 500;
  color: #7f68b0;
  font-size: 0.97em;
  max-width: 170px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.account-caret {
  font-size: 0.72em;
  color: #8f79be;
  display: inline-flex;
  align-items: center;
  transition: transform 0.16s ease;
}

.account-shell.menu-open .account-caret {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  min-width: 220px;
  border-radius: 0.95rem;
  border: 1px solid rgba(160, 124, 255, 0.3);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px rgba(120, 90, 190, 0.2);
  padding: 0.38rem;
  z-index: 15;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.58rem 0.54rem;
  margin-bottom: 0.32rem;
  border-radius: 0.65rem;
  color: #6e5b95;
  background: rgba(160, 124, 255, 0.09);
}

.account-menu-email {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.account-menu-action {
  width: 100%;
  border: none;
  background: transparent;
  color: #684f9d;
  text-align: left;
  border-radius: 0.65rem;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 0.55rem 0.62rem;
  cursor: pointer;
}

.account-menu-action:hover {
  background: rgba(160, 124, 255, 0.14);
}

.account-menu-action:focus-visible {
  outline: 2px solid rgba(136, 88, 255, 0.45);
  outline-offset: 1px;
}

.account-menu-action--danger {
  color: #a13e64;
}

.account-menu-action--danger:hover {
  background: rgba(206, 79, 126, 0.13);
}

@media (max-width: 720px) {
  .user-info-bar {
    left: auto;
    right: 0.75rem;
    transform: translateY(-12px);
    padding: 0.45em 1.05em 0.45em 0.65em;
    max-width: calc(100vw - 1rem);
    overflow: visible;
  }
  .quick-nav-shell {
    margin-right: 0;
  }
  .quick-nav-toggle {
    display: inline-flex;
  }
  .quick-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 9.4rem;
    padding: 0.38rem;
    border-radius: 0.95em;
    border: 1px solid rgba(160, 124, 255, 0.28);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 26px rgba(120, 90, 190, 0.19);
    flex-direction: column;
    gap: 0.22em;
    z-index: 12;
  }
  .user-info-bar.quick-nav-open .quick-nav {
    display: flex;
  }

  .account-toggle {
    padding: 0.28em 0.45em;
    gap: 0.34em;
  }

  .user-email {
    max-width: 120px;
    font-size: 0.9rem;
  }

  .account-menu {
    min-width: min(240px, calc(100vw - 1.2rem));
    right: -0.12rem;
    top: calc(100% + 0.45rem);
  }

  .quick-nav a {
    width: 100%;
    text-align: left;
    padding: 0.45em 0.65em;
    font-size: 0.95em;
  }

  .preview-banner {
    font-size: 0.75rem;
    padding: 0.35rem 0;
  }
}

/* Terms acceptance modal */
body.terms-modal-open {
  overflow: hidden;
}

.terms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 22, 73, 0.7);
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.terms-modal {
  max-width: 540px;
  width: 100%;
  background: #fff;
  color: #2a2340;
  border-radius: 18px;
  box-shadow: 0 28px 58px rgba(24, 39, 75, 0.28);
  padding: 32px;
  line-height: 1.6;
}

.terms-modal h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
}

.terms-body {
  max-height: 48vh;
  overflow-y: auto;
  margin-bottom: 18px;
}

.terms-body a {
  color: #6a4bff;
}

.terms-points {
  margin: 18px 0 0;
  padding-left: 20px;
}

.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  margin-top: 12px;
}

.terms-checkbox input[type="checkbox"] {
  margin-top: 4px;
}

.terms-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.terms-btn {
  background: linear-gradient(90deg, #6a4bff 10%, #4b2ce0 90%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(80, 60, 180, 0.18);
}

.terms-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.terms-error {
  color: #c03535;
  margin-top: 16px;
  display: none;
}
