/* Sign-in dialog layout.
   Shared by the explorer shell (theme.css) and the static pages (pages.css),
   because the dialog markup is created at runtime by auth.js. */

.pe-hidden {
  display: none !important;
}

.pe-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
}

.pe-form .pe-input {
  flex: 1 1 auto;
  min-width: 0;
}

.pe-form .pe-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.pe-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line, rgba(110, 150, 220, 0.26));
  background: var(--panel-2, #0e1a31);
  color: var(--ink, #dfe8ff);
  font: 400 13px/1.5 Iosevka, ui-monospace, "SF Mono", Menlo, monospace;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pe-input::placeholder {
  color: var(--ink-muted, #7889a9);
}

.pe-input:focus {
  outline: 0;
  border-color: var(--blue, #4d8dff);
  box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.18);
}

.pe-hint {
  margin: 0 0 10px;
  font: 400 11.5px/1.6 Iosevka, ui-monospace, monospace;
  color: var(--ink-muted, #7889a9);
}

/* the verification code sits above its two buttons, so it needs its own spacing */
.pe-modal-card > div > .pe-input {
  margin-bottom: 10px;
}

.pe-modal-card .pe-actions {
  margin-top: 2px;
}

@media (max-width: 520px) {
  .pe-form {
    flex-direction: column;
  }

  .pe-form .pe-btn {
    width: 100%;
    text-align: center;
  }

  .pe-actions .pe-btn {
    flex: 1 1 100%;
  }
}

/* ── dialog shell ─────────────────────────────────────────────────
   Duplicated from theme.css so the dialog also works on the static
   pages (pricing / guide / about), which do not load the app theme. */

.pe-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 8, 20, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pe-modal-card {
  position: relative;
  width: min(356px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px 18px 16px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(110, 150, 220, 0.26));
  background: var(--panel, #0a1224);
  color: var(--ink-soft, #a6b8d8);
  box-shadow: 0 24px 60px rgba(2, 6, 18, 0.4);
  text-align: left;
}

.pe-modal-card h2 {
  margin: 6px 0 6px;
  font: 500 16px/1.3 Iosevka, ui-monospace, monospace;
  color: var(--ink-strong, #f4f8ff);
}

.pe-modal-card p {
  margin: 0 0 10px;
  font: 400 11.5px/1.55 Iosevka, ui-monospace, monospace;
  color: var(--ink-soft, #a6b8d8);
}

.pe-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  font: 500 10px/1 Iosevka, ui-monospace, monospace;
  letter-spacing: 0.1em;
  color: var(--blue, #4d8dff);
  background: rgba(77, 141, 255, 0.12);
  border: 1px solid rgba(77, 141, 255, 0.34);
}

.pe-close {
  position: absolute;
  top: 10px;
  right: 12px;
  appearance: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--ink-muted, #7889a9);
  font: 400 18px/1 Iosevka, ui-monospace, monospace;
}

.pe-btn {
  appearance: none;
  cursor: pointer;
  font: 500 12px/1 Iosevka, ui-monospace, monospace;
  letter-spacing: 0.04em;
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid var(--line, rgba(110, 150, 220, 0.26));
  color: var(--ink, #dfe8ff);
  background: var(--panel, #0a1224);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pe-btn:hover {
  border-color: var(--blue, #4d8dff);
}

.pe-btn.pe-primary {
  background: var(--blue, #4d8dff);
  border-color: var(--blue, #4d8dff);
  color: #ffffff;
}

.pe-btn.pe-primary:hover {
  filter: brightness(1.08);
}

.pe-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.pe-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  background: var(--panel-2, #0e1a31);
}

.pe-google svg {
  flex: 0 0 auto;
}

.pe-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  font: 500 10px/1 Iosevka, ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted, #7889a9);
}

.pe-divider::before,
.pe-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft, rgba(110, 150, 220, 0.14));
}

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

.pe-actions .pe-btn {
  flex: 1 1 140px;
  text-align: center;
}

.pe-error {
  margin: 10px 0 0;
  font: 400 11px/1.6 Iosevka, ui-monospace, monospace;
  color: #e5484d;
}

/* ── instant sign-in shell ──────────────────────────────────────
   Shown synchronously on click while the auth bundle / Clerk warm up. */
.pe-auth-boot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  font: 400 12px/1.6 Iosevka, ui-monospace, monospace;
  color: var(--ink-muted, #7889a9);
}

.pe-spinner {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line, rgba(110, 150, 220, 0.26));
  border-top-color: var(--blue, #4d8dff);
  animation: pe-spin 0.7s linear infinite;
}

@keyframes pe-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pe-spinner { animation-duration: 2s; }
}

/* Ultimate tier inside the Pro paywall */
.pe-ultimate {
  margin: 12px 0 0;
  padding: 10px 12px 11px;
  border: 1px solid rgba(239, 156, 44, 0.45);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(239, 156, 44, 0.13), rgba(239, 156, 44, 0.04));
}
.pe-ultimate-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pe-ultimate-head b {
  font: 600 12.5px/1.2 inherit;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffc46b;
}
.pe-ultimate-head .pe-hot {
  font: 600 9.5px/1 inherit;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc46b, #ef9c2c);
  color: #20160a;
}
.pe-ultimate-head em {
  margin-left: auto;
  font: 600 15px/1 inherit;
  font-style: normal;
  color: #ffffff;
}
.pe-ultimate p {
  margin: 6px 0 0;
  font: 400 11px/1.5 inherit;
  color: #93a7cd;
}
.pe-btn.pe-gold {
  background: linear-gradient(90deg, #ffc46b, #ef9c2c);
  border-color: #ef9c2c;
  color: #20160a;
  font-weight: 600;
}
.pe-btn.pe-gold:hover {
  filter: brightness(1.06);
}

/* Plan selector inside the paywall dialog */
.pe-plans { display: grid; gap: 10px; margin: 16px 0 14px; }
.pe-plan-option {
  position: relative;
  display: block;
  width: 100%;
  padding: 13px 44px 13px 15px;
  border: 1px solid rgba(110, 150, 220, 0.28);
  border-radius: 12px;
  background: rgba(9, 17, 34, 0.72);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.pe-plan-option:hover { border-color: rgba(110, 150, 220, 0.55); }
.pe-plan-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pe-plan-head b { font-size: 15px; font-weight: 600; flex: 0 0 auto; white-space: nowrap; }
.pe-plan-head strong { margin-left: auto; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pe-plan-option p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; opacity: 0.72; }
.pe-plan-check {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  border: 1px solid rgba(110, 150, 220, 0.45);
  color: transparent;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}
.pe-plan-option.is-selected { border-color: #ef9c2c; background: rgba(239, 156, 44, 0.1); box-shadow: 0 0 0 1px rgba(239, 156, 44, 0.35) inset; }
.pe-plan-option.is-selected .pe-plan-check { border-color: #ef9c2c; background: #ef9c2c; color: #1b1206; font-weight: 700; }
.pe-plan-option.is-gold:not(.is-selected) { border-color: rgba(239, 156, 44, 0.4); }
/* Badge next to "Ultimate" — a pill, never plain wrapping text. */
.pe-plan-option .pe-hot {
  flex: 0 0 auto;
  margin-left: 0;
  white-space: nowrap;
  font: 600 9.5px/1 inherit;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc46b, #ef9c2c);
  color: #20160a;
}
.pe-plan-option .pe-plan-head strong { flex: 0 0 auto; margin-left: auto; }
