/* ══════════════════════════════════════════════════════════════
   FLOORLESS ACCESS GATE — Modal Styles
   Prefix: fg- (floorless gate) to avoid conflicts
   Depends on brand.css for --fl-* custom properties
   ══════════════════════════════════════════════════════════════ */

/* ── Overlay ───────────────────────────────────────────────── */
.fg-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  animation: fg-fade-in 200ms ease-out forwards;
}

.fg-overlay[aria-hidden="true"] {
  display: none;
}

/* ── Modal Card ────────────────────────────────────────────── */
.fg-modal {
  width: 90vw;
  max-width: 440px;
  background: var(--fl-card, #1a1a20);
  border: 1px solid var(--fl-border, rgba(255,255,255,0.08));
  border-radius: 16px;
  padding: 40px 32px 32px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 40px rgba(0,0,0,0.5),
    0 2px 12px rgba(0,0,0,0.3);
  overflow: hidden;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  animation: fg-slide-up 300ms ease-out 80ms forwards;
}

/* ── Logo Area ─────────────────────────────────────────────── */
.fg-logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  width: 88px;
  height: 52px;
}

.fg-logo-area .brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fg-logo-area .brand-icon img,
.fg-logo-area .brand-icon svg {
  height: 40px;
  width: 72px;
}

/* ── Typography ────────────────────────────────────────────── */
.fg-headline {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--fl-text, #f0f0f2);
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.25;
}

.fg-subhead {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--fl-text-mid, #a0a0ae);
  text-align: center;
  margin: 0 auto 20px;
  max-width: 340px;
  line-height: 1.55;
}

/* ── Value List ────────────────────────────────────────────── */
.fg-value-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 12px;
}

.fg-value-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--fl-text-mid, #a0a0ae);
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.fg-value-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fl-accent, #4f7df9);
}

/* ── Input ─────────────────────────────────────────────────── */
.fg-input-wrap {
  margin-bottom: 12px;
}

.fg-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--fl-text, #f0f0f2);
  background: var(--fl-surface, #141418);
  border: 1px solid var(--fl-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
  box-sizing: border-box;
}

.fg-input::placeholder {
  color: var(--fl-text-dim, #6a6a78);
}

.fg-input:focus {
  border-color: var(--fl-accent, #4f7df9);
  box-shadow: 0 0 0 3px rgba(79, 125, 249, 0.15);
}

.fg-input--error {
  border-color: var(--fl-red, #f87171);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

/* ── Primary CTA ───────────────────────────────────────────── */
.fg-cta {
  display: block;
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #fff;
  background: var(--fl-accent, #4f7df9);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms, box-shadow 150ms, transform 80ms;
  position: relative;
}

.fg-cta:hover {
  background: #3d6be8;
  box-shadow: 0 4px 16px rgba(79, 125, 249, 0.25);
}

.fg-cta:active {
  transform: scale(0.985);
}

.fg-cta:disabled,
.fg-cta--loading {
  opacity: 0.5;
  cursor: not-allowed;
}

.fg-cta--loading .fg-cta-text { visibility: hidden; }

.fg-cta--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fg-spin 600ms linear infinite;
}

.fg-cta:focus-visible {
  outline: 2px solid var(--fl-accent, #4f7df9);
  outline-offset: 2px;
}

/* ── Secondary Link ────────────────────────────────────────── */
.fg-secondary-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--fl-text-dim, #6a6a78);
  background: none;
  border: none;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
  transition: color 150ms;
  padding: 4px;
}

.fg-secondary-link:hover {
  color: var(--fl-text-mid, #a0a0ae);
  text-decoration: underline;
}

.fg-secondary-link:focus-visible {
  outline: 2px solid var(--fl-accent, #4f7df9);
  outline-offset: 2px;
}

/* ── Fine Print ────────────────────────────────────────────── */
.fg-fine-print {
  text-align: center;
  font-size: 10px;
  color: var(--fl-text-dim, #6a6a78);
  margin: 14px 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ── Success State ─────────────────────────────────────────── */
.fg-success {
  display: none;
  text-align: center;
  padding: 20px 0 8px;
}

.fg-success.active { display: block; }
.fg-form.hidden { display: none; }

.fg-success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fg-success-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--fl-green, #34d399);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fg-success-headline {
  font-size: 20px;
  font-weight: 700;
  color: var(--fl-text, #f0f0f2);
  margin: 0 0 8px;
}

.fg-success-body {
  font-size: 13px;
  color: var(--fl-text-mid, #a0a0ae);
  margin: 0;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

/* ── Error Message ─────────────────────────────────────────── */
.fg-error-msg {
  font-size: 12px;
  color: var(--fl-red, #f87171);
  text-align: center;
  margin: 8px 0 0;
  min-height: 16px;
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fg-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fg-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Responsive: Mobile ────────────────────────────────────── */
@media (max-width: 480px) {
  .fg-overlay {
    align-items: flex-end;
  }

  .fg-modal {
    width: 100vw;
    max-width: 100vw;
    border-radius: 16px 16px 0 0;
    padding: 32px 24px 28px;
    transform: translateY(40px);
  }

  .fg-logo-area {
    width: 72px;
    height: 44px;
  }

  .fg-logo-area .brand-icon img,
  .fg-logo-area .brand-icon svg {
    height: 32px;
    width: 56px;
  }

  .fg-headline {
    font-size: 20px;
  }
}

/* ── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fg-overlay,
  .fg-modal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .fg-cta--loading::after {
    animation: none;
  }
}
