/* Password form for configurator pages. Brand values come from the --bfc-* variables printed from the brand file. */

.bfc-gate {
  --bfc-primary: #0d3a5d;
  --bfc-primary-ink: #ffffff;
  --bfc-primary-soft: #f1f4f7;
  --bfc-accent: #b8932f;
  --bfc-ink: #1b2a36;
  --bfc-muted: #5d6b74;
  --bfc-line: #d8dee3;
  --bfc-surface: #ffffff;
  --bfc-stage-top: #eef2f5;
  --bfc-stage-bottom: #dfe5ea;
  --bfc-danger: #b42318;
  --bfc-radius: 0px;
  --bfc-font-body: 'Helvetica Neue', Arial, sans-serif;
  --bfc-font-heading: 'Helvetica Neue', Arial, sans-serif;

  box-sizing: border-box;
  padding: clamp(40px, 7vw, 96px) 20px;
  background: linear-gradient(180deg, var(--bfc-stage-top), var(--bfc-stage-bottom));
  font-family: var(--bfc-font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--bfc-ink);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  container-type: inline-size;
  container-name: bfc-gate;
}

.bfc-gate *,
.bfc-gate *::before,
.bfc-gate *::after {
  box-sizing: border-box;
}

.bfc-gate [hidden] {
  display: none !important;
}

.bfc-gate-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  max-width: 1040px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bfc-surface);
  border-radius: var(--bfc-radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 28px 60px -28px rgba(16, 24, 40, 0.35);
  animation: bfc-gate-in 0.45s ease-out both;
}

@keyframes bfc-gate-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- brand panel ---------- */

.bfc-gate-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 40px 36px 36px;
  color: #ffffff;
  background-color: var(--bfc-primary);
  background-image:
    radial-gradient(120% 80% at 15% 0%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.2));
}

.bfc-gate-art {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
}

.bfc-gate-door {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.bfc-gate-door .bfc-gate-shadow { fill: #000000; opacity: 0.22; }
.bfc-gate-door .bfc-gate-dim { fill: none; stroke: var(--bfc-accent); stroke-width: 1.5; }
.bfc-gate-door .bfc-gate-sky { fill: #ffffff; opacity: 0.05; }
.bfc-gate-door .bfc-gate-deck { fill: none; stroke: #ffffff; stroke-opacity: 0.2; stroke-width: 1; }
.bfc-gate-door .bfc-gate-frame { fill: none; stroke: #ffffff; stroke-width: 3; }
.bfc-gate-door .bfc-gate-panel { fill: #ffffff; fill-opacity: 0.08; stroke: #ffffff; stroke-width: 2; }
.bfc-gate-door .bfc-gate-glass { fill: none; stroke: #ffffff; stroke-opacity: 0.35; stroke-width: 1; }
.bfc-gate-door .bfc-gate-glint { fill: none; stroke: #ffffff; stroke-opacity: 0.3; stroke-width: 1.5; stroke-linecap: round; }
.bfc-gate-door .bfc-gate-handle { fill: var(--bfc-accent); }
.bfc-gate-door .bfc-gate-leaf { stroke: #ffffff; stroke-width: 2; stroke-linejoin: round; }
.bfc-gate-door .bfc-gate-leaf--light { fill: #ffffff; fill-opacity: 0.2; }
.bfc-gate-door .bfc-gate-leaf--dark { fill: #ffffff; fill-opacity: 0.07; }
.bfc-gate-door .bfc-gate-floor { fill: none; stroke: #ffffff; stroke-opacity: 0.45; stroke-width: 2; }

.bfc-gate-mark {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bfc-gate-mark::before {
  content: '';
  width: 32px;
  height: 3px;
  margin-bottom: 6px;
  background: var(--bfc-accent);
}

.bfc-gate-mark-name {
  font-family: var(--bfc-font-heading);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.bfc-gate-mark-tagline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

/* ---------- form panel ---------- */

.bfc-gate-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 56px);
}

.bfc-gate .bfc-gate-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bfc-primary);
}

.bfc-gate-eyebrow svg {
  flex: 0 0 auto;
  color: var(--bfc-accent);
}

.bfc-gate .bfc-gate-title {
  margin: 0 0 14px;
  padding: 0;
  font-family: var(--bfc-font-heading);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--bfc-ink);
}

.bfc-gate .bfc-gate-intro {
  max-width: 46ch;
  margin: 0 0 30px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--bfc-muted);
}

.bfc-gate .bfc-gate-form {
  margin: 0;
  padding: 0;
}

.bfc-gate .bfc-gate-label {
  margin: 0 0 8px;
}

.bfc-gate .bfc-gate-label label {
  display: block;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--bfc-ink);
}

.bfc-gate .bfc-gate-field {
  display: flex;
  align-items: stretch;
  background: var(--bfc-surface);
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: var(--bfc-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bfc-gate .bfc-gate-field:focus-within {
  border-color: var(--bfc-primary);
  box-shadow: 0 0 0 1px var(--bfc-primary);
}

.bfc-gate .bfc-gate-field.is-invalid {
  border-color: var(--bfc-danger);
  box-shadow: 0 0 0 1px var(--bfc-danger);
}

.bfc-gate .bfc-gate-field input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 56px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font: inherit;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--bfc-ink);
  -webkit-appearance: none;
  appearance: none;
}

.bfc-gate .bfc-gate-toggle {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid var(--bfc-line);
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--bfc-primary);
  cursor: pointer;
}

.bfc-gate .bfc-gate-toggle:hover {
  background: var(--bfc-primary-soft);
}

.bfc-gate .bfc-gate-toggle:focus-visible {
  outline: 2px solid var(--bfc-primary);
  outline-offset: -4px;
}

.bfc-gate .bfc-gate-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--bfc-danger);
}

.bfc-gate-error svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.bfc-gate .bfc-gate-actions {
  margin: 20px 0 0;
}

.bfc-gate .bfc-gate-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-radius: var(--bfc-radius);
  background-color: var(--bfc-primary);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--bfc-primary-ink);
  cursor: pointer;
}

.bfc-gate .bfc-gate-submit:hover {
  background-image: linear-gradient(rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.16));
}

.bfc-gate .bfc-gate-submit:focus-visible {
  outline: 3px solid var(--bfc-accent);
  outline-offset: 2px;
}

.bfc-gate-submit svg {
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.bfc-gate-submit:hover svg {
  transform: translateX(3px);
}

.bfc-gate .bfc-gate-help {
  margin: 28px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--bfc-line);
  font-size: 15px;
  line-height: 1.6;
  color: var(--bfc-muted);
}

.bfc-gate .bfc-gate-help a {
  font-weight: 600;
  color: var(--bfc-primary);
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-underline-offset: 3px;
}

.bfc-gate .bfc-gate-help a:hover {
  text-decoration-color: currentColor;
}

.bfc-gate .bfc-gate-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- narrow ---------- */

@container bfc-gate (max-width: 760px) {
  .bfc-gate-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .bfc-gate-visual {
    gap: 18px;
    padding: 24px 24px 22px;
  }

  .bfc-gate-door {
    max-width: 260px;
  }

  .bfc-gate-mark-name {
    font-size: 24px;
  }

  .bfc-gate-body {
    padding: 28px 22px 30px;
  }
}

@media (max-width: 600px) {
  .bfc-gate {
    padding: 20px 14px 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfc-gate-card {
    animation: none;
  }

  .bfc-gate-submit svg {
    transition: none;
  }
}
