/* The gate's look: Framer's site-password page in its dark scheme, measured on a live protected site
   (README.md). One field, nothing else on screen. */
@font-face {
  font-display: swap;
  font-family: "Inter Variable UI";
  font-style: normal;
  font-weight: 100 900;
  src: url("/InterVariable.woff2") format("woff2");
}

:root {
  --background: #111;
  --input-background: #1f1f1f;
  --input-text: #fff;
  --input-placeholder: #999;
  --input-border-focus: rgba(255, 255, 255, 0.07);
  --selection-background: rgba(255, 255, 255, 0.15);
  --selection-text: #fff;
  color-scheme: dark;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  box-sizing: border-box;
  padding: 24px;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  background-color: var(--background);
  color: #999;
}

body,
input {
  font-family: "Inter Variable UI", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-feature-settings: "cv01" 1, "cv05" 1, "cv09" 1, "cv11" 1;
}

::selection {
  background-color: var(--selection-background);
  color: var(--selection-text);
}

main {
  display: flex;
  width: 200px;
  flex-direction: column;
  align-items: center;
}

#form {
  display: flex;
  width: 100%;
}

.formfield {
  display: flex;
  width: 100%;
  height: 30px;
  box-sizing: border-box;
  align-items: center;
  border: 1px solid transparent;
  background-color: var(--input-background);
  border-radius: 8px;
}

.formfield:focus-within {
  border-color: var(--input-border-focus);
}

.input {
  width: 1px;
  height: 100%;
  box-sizing: border-box;
  flex-grow: 1;
  padding: 0 7px 1px;
  border: none;
  margin: 0;
  background: none;
  color: var(--input-text);
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0;
  outline: none;
}

/* iOS Safari zooms on focus below 16px; only iOS exposes -webkit-touch-callout. */
@supports (-webkit-touch-callout: none) {
  .input {
    font-size: 16px;
  }
}

.input::placeholder {
  color: var(--input-placeholder);
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active {
  box-shadow: 0 0 0 50px var(--input-background) inset;
  -webkit-text-fill-color: var(--input-text);
}

.error-message {
  display: none;
  flex-shrink: 0;
  padding: 0 8px 0 4px;
  color: var(--input-placeholder);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 450;
}

#form.has-error .active {
  display: block;
}

/* Waiting for the server: the field dims the way the reference's disabled control does (opacity 0.5). */
#form.is-loading .formfield {
  opacity: 0.5;
}

#form.is-loading .input {
  cursor: default;
}

/* Wrong password: the field shakes once and stays, value kept. */
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  15%, 55% { transform: translateX(-6px); }
  35%, 75% { transform: translateX(6px); }
  90% { transform: translateX(-2px); }
}

#form.is-shaking .formfield {
  animation: gate-shake 360ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@media (prefers-reduced-motion: reduce) {
  #form.is-shaking .formfield {
    animation: none;
  }
}

/* The right password: the demo fills the window on black, nothing around it. */
body.is-open {
  padding: 0;
  background-color: #000;
  overflow: hidden;
}

body.is-open main {
  display: none;
}

.demo-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  display: block;
  background-color: #000;
}
