/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --fb-blue: #1877f2;
  --fb-blue-hover: #166fe5;
  --fb-green: #42b72a;
  --fb-green-hover: #36a420;
  --text-primary: #1c1e21;
  --text-secondary: #606770;
  --border: #dddfe2;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --radius: 8px;
  --shadow: 0 2px 4px rgba(0,0,0,.1), 0 8px 16px rgba(0,0,0,.1);
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 28px 16px 64px;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================================
   BRANDING (left)
   ============================================================ */
.branding {
  flex: 1 1 400px;
  max-width: 440px;
  padding-top: 40px;
}

.branding__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo svg {
  width: 240px;
  height: 80px;
  /* Recolour the white path to FB-blue */
}

/* Override: render the logo path in FB blue against transparent bg */
.logo svg path {
  fill: var(--fb-blue);
}

.logo {
  margin-left: -12px; /* optical alignment */
  margin-bottom: 4px;
}

.tagline {
  font-size: 1.5625rem; /* 25px */
  font-weight: 400;
  line-height: 1.32;
  color: var(--text-primary);
  max-width: 400px;
}

/* ============================================================
   FORM SECTION (right)
   ============================================================ */
.form-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px 28px;
  width: 396px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.field {
  width: 100%;
  margin-bottom: 12px;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--card-bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}

.field input::placeholder {
  color: #8a8d91;
}

.field input:focus {
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 2px rgba(24,119,242,.2);
}

.field input.input-error {
  border-color: #f02849;
  box-shadow: 0 0 0 2px rgba(240,40,73,.2);
}

/* Password wrapper */
.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 52px;
}

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #606770;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}

.toggle-pw:hover { color: var(--text-primary); }

.toggle-pw svg {
  width: 20px;
  height: 20px;
}

/* Error message */
.error-msg {
  background: #fff1f2;
  border: 1px solid #f02849;
  color: #f02849;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .875rem;
  margin-bottom: 12px;
  width: 100%;
  text-align: center;
}

/* Log in button */
.btn-login {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius);
  background: var(--fb-blue);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .08s;
  font-family: var(--font);
  letter-spacing: .2px;
}

.btn-login:hover  { background: var(--fb-blue-hover); }
.btn-login:active { transform: scale(.98); }

/* Forgot */
.forgot-link {
  display: block;
  margin: 16px 0;
  font-size: .9375rem;
  color: var(--fb-blue);
  text-decoration: none;
  text-align: center;
  transition: text-decoration .1s;
}

.forgot-link:hover { text-decoration: underline; }

/* Divider */
.divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0 20px;
}

/* Create account */
.btn-create {
  background: var(--fb-green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0 20px;
  height: 52px;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s, transform .08s;
  letter-spacing: .2px;
}

.btn-create:hover  { background: var(--fb-green-hover); }
.btn-create:active { transform: scale(.98); }

/* Page CTA */
.page-cta {
  font-size: .875rem;
  color: var(--text-primary);
  text-align: center;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px 16px;
  background: var(--bg);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  max-width: 980px;
  margin: 0 auto 12px;
}

.footer-links a {
  font-size: .75rem;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: text-decoration .1s;
}

.footer-links a:hover { text-decoration: underline; }

.footer-meta {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Language selector */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-selector select {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: .75rem;
  color: var(--text-secondary);
  background: var(--card-bg);
  cursor: pointer;
  outline: none;
  height: 26px;
}

.lang-selector select:focus {
  border-color: var(--fb-blue);
}

.add-lang {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}

.add-lang:hover { background: #e4e6eb; }

.copyright {
  font-size: .75rem;
  color: var(--text-secondary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .page {
    flex-direction: column;
    align-items: center;
    padding-top: 24px;
  }

  .branding {
    max-width: 396px;
    padding-top: 0;
    text-align: center;
  }

  .logo {
    display: flex;
    justify-content: center;
    margin-left: 0;
  }

  .logo svg {
    width: 200px;
    height: 66px;
  }

  .tagline {
    font-size: 1.125rem;
    margin: 0 auto;
  }

  .card { width: 100%; }
}

@media (max-width: 480px) {
  .card { padding: 16px 12px 24px; }
  .btn-login, .field input { height: 48px; }
}
