:root {
  --ig-primary-blue: #0095f6;
  --ig-btn-desktop: #4cb5f9;
  --ig-btn-mobile: #0064e0;
  --ig-btn-hover: #0081d6;
  --ig-text-primary: #000000;
  --ig-text-secondary: #737373;
  --ig-text-subtle: #8e8e8e;
  --ig-input-border: #ccd0d5;
  --ig-input-bg: #ffffff;
  --ig-divider: #e4e6eb;
  --ig-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: #ffffff;
  color: var(--ig-text-primary);
  font-family: var(--ig-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Base App Container
   ========================================================================== */
.fb-app-container {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.fb-form-wrapper {
  width: 100%;
  max-width: 396px;
  margin: 0 auto;
}

.desktop-form-heading {
  display: none;
}

.desktop-form-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ig-text-primary);
  margin: 0 0 1.15rem 0;
  letter-spacing: -0.01em;
}

.fb-field-group {
  margin-bottom: 0.75rem;
}

.fb-form-input {
  width: 100%;
  height: 52px;
  padding: 0 1rem;
  background-color: var(--ig-input-bg);
  border: 1px solid var(--ig-input-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ig-text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.fb-form-input::placeholder {
  color: var(--ig-text-secondary);
  opacity: 1;
}

.fb-form-input:focus {
  border-color: var(--ig-primary-blue);
  box-shadow: 0 0 0 1.5px var(--ig-primary-blue);
}

.fb-password-container {
  position: relative;
  width: 100%;
}

.fb-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ig-text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px;
}

.fb-btn-login {
  width: 100%;
  height: 44px;
  margin-top: 0.25rem;
  background-color: var(--ig-btn-desktop);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.fb-btn-login:hover {
  background-color: var(--ig-primary-blue);
}

.fb-btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.forgotten-password-wrap {
  text-align: center;
  margin-top: 1rem;
}

.forgotten-password-link {
  color: var(--ig-text-primary);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.forgotten-password-link:hover {
  opacity: 0.75;
}

/* Log in with Facebook (Desktop) */
.btn-fb-login {
  display: none;
  width: 100%;
  height: 44px;
  background-color: #f0f2f5;
  border: none;
  border-radius: 9999px;
  color: #000000;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 0.85rem;
  transition: background-color 0.15s ease;
}

.btn-fb-login:hover {
  background-color: #e4e6eb;
}

/* Create new account */
.fb-btn-create {
  width: 100%;
  height: 44px;
  background-color: transparent;
  border: 1.5px solid var(--ig-primary-blue);
  border-radius: 9999px;
  color: var(--ig-primary-blue);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.fb-btn-create:hover {
  background-color: rgba(0, 149, 246, 0.05);
}

/* Meta Branding */
.meta-branding-block {
  margin-top: 1.5rem;
  text-align: center;
}

.meta-logo-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.meta-svg {
  display: inline-block;
  vertical-align: middle;
}

.meta-text {
  font-size: 15px;
  font-weight: 700;
  color: #1c2b33;
  letter-spacing: -0.01em;
}

/* Alerts */
.alert {
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

/* ==========================================================================
   Mobile-Specific Styles (< 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
  .fb-desktop-left {
    display: none !important;
  }

  .btn-fb-login {
    display: none !important;
  }

  .fb-main-form-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    min-height: 100svh;
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .mobile-top-header {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .mobile-language {
    color: var(--ig-text-secondary);
    font-size: 14px;
    margin-top: 0.5rem;
    margin-bottom: 2.5rem;
  }

  .mobile-logo-wrap {
    margin-bottom: 2.75rem;
  }

  .fb-form-input {
    height: 54px;
    border-radius: 14px;
    font-size: 15px;
  }

  .fb-btn-login {
    height: 48px;
    border-radius: 9999px;
    background-color: var(--ig-btn-mobile);
    font-size: 16px;
    font-weight: 700;
  }

  .fb-btn-login:hover {
    background-color: #0056bd;
  }

  .forgotten-password-link {
    font-size: 15px;
    font-weight: 600;
  }

  .mobile-spacer {
    flex-grow: 1;
    min-height: 3rem;
  }

  .bottom-action-wrapper {
    margin-top: auto;
  }

  .fb-btn-create {
    border-color: var(--ig-btn-mobile);
    color: var(--ig-btn-mobile);
  }

  .meta-branding-block {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
  }
}

/* ==========================================================================
   Desktop-Specific Styles (>= 768px)
   ========================================================================== */
@media (min-width: 768px) {
  .fb-app-container {
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
  }

  /* Left Showcase Panel */
  .fb-desktop-left {
    flex: 1 1 57%;
    max-width: 58%;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 3rem 2.5rem 4rem;
    border-right: 1px solid var(--ig-divider);
    background-color: #ffffff;
    position: relative;
    overflow-y: auto;
  }

  .desktop-top-logo {
    margin-bottom: 1rem;
  }

  .desktop-visual-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 1rem 0;
  }

  .desktop-headline-wrap {
    width: 100%;
    margin-bottom: 2rem;
  }

  .desktop-headline {
    margin: 0;
    font-size: clamp(2rem, 2.6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #000000;
  }

  .gradient-close {
    background: linear-gradient(90deg, #ff6934, #ff2a6d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
  }

  .gradient-friends {
    background: linear-gradient(90deg, #ff007a, #c13584);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
  }

  .desktop-collage-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .desktop-collage-img {
    max-width: 360px;
    width: 100%;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
  }

  /* Right Form Panel */
  .fb-main-form-section {
    flex: 1 1 43%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background-color: #ffffff;
  }

  .mobile-top-header {
    display: none;
  }

  .desktop-form-heading {
    display: block;
  }

  .btn-fb-login {
    display: flex;
  }

  .mobile-spacer {
    display: none;
  }

  .bottom-action-wrapper {
    margin-top: 2rem;
  }

  .forgotten-password-wrap {
    margin-top: 1rem;
    margin-bottom: 1.75rem;
  }

  .fb-field-group {
    margin-bottom: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .fb-desktop-left {
    padding: 3rem 4rem 3rem 5rem;
  }

  .desktop-headline {
    font-size: 2.45rem;
  }

  .desktop-collage-img {
    max-width: 380px;
  }

  .fb-main-form-section {
    padding: 3rem 4.5rem;
  }
}
