*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --auth-bg: #121212;
  --text: #f5f5f5;
  --input-border: #555555;
  --btn-login: #00376b;
  --btn-login-text: #4a7ba7;
  --btn-login-active: #0095f6;
  --btn-login-active-text: #ffffff;
  --btn-secondary: #1a1a1a;
  --btn-create-border: #0095f6;
  --btn-create-text: #0095f6;
  --footer: #a8a8a8;
  --field-radius: 12px;
  --btn-radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  min-height: calc(100vh - 90px);
}

/* ===== Hero ===== */
.hero {
  background: #000;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 40px 40px;
  overflow: hidden;
}

.ig-logo {
  display: block;
  width: 40px;
  height: 40px;
  max-width: 56px;
  flex-shrink: 0;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 32px;
}

.hero-title {
  max-width: 540px;
  text-align: center;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 48px;
  color: #fff;
}

.gradient-text {
  background: linear-gradient(90deg, #ff7a18, #ff3d77 40%, #c135ff 70%, #6a5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stories {
  position: relative;
  width: min(460px, 78%);
  height: 430px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story {
  position: absolute;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
}

.story img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-back-left {
  width: 190px;
  height: 310px;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-9deg);
  opacity: 0.9;
  z-index: 1;
}

.story-back-right {
  width: 190px;
  height: 310px;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(9deg);
  opacity: 0.9;
  z-index: 1;
}

.story-badge {
  position: absolute;
  z-index: 2;
  font-size: 22px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.story-badge.heart {
  right: 12px;
  bottom: 70px;
}

.story-badge.star {
  right: 14px;
  top: 70px;
  color: #7dffa3;
  font-size: 26px;
}

.story-front {
  width: 230px;
  height: 390px;
  z-index: 3;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.story-progress {
  display: flex;
  gap: 4px;
  padding: 10px 10px 6px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

.story-progress span {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.story-progress span.on {
  background: #fff;
}

.story-user {
  position: absolute;
  top: 18px;
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

.story-photo {
  width: 100%;
  height: 100%;
}

.story-reactions {
  position: absolute;
  right: 10px;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.story-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  z-index: 2;
}

.story-bar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #444;
  flex-shrink: 0;
}

.story-bar-input {
  flex: 1;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.story-bar-icons {
  color: #fff;
  font-size: 14px;
  letter-spacing: 4px;
  white-space: nowrap;
}

.float-emoji {
  position: absolute;
  z-index: 4;
  font-size: 28px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  animation: float 3.5s ease-in-out infinite;
}

.float-1 {
  left: 16%;
  top: 16%;
}

.float-2 {
  right: 10%;
  top: 26%;
  animation-delay: 0.6s;
}

.float-3 {
  right: 20%;
  bottom: 16%;
  animation-delay: 1.2s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ===== Auth ===== */
.auth {
  background: var(--auth-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  border-left: 1px solid #1f1f1f;
}

.auth-inner {
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
}

.auth-mobile-logo {
  display: none;
  justify-content: center;
  padding: 8px 0 16px;
}

.auth-mobile-logo .ig-logo {
  width: 56px;
  height: 56px;
}

.auth-divider {
  display: none;
  border: none;
  border-top: 1px solid #262626;
  margin: 0 0 24px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  position: relative;
  display: block;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: var(--field-radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input::placeholder {
  color: #8e8e8e;
}

.field input:focus {
  border-color: #8e8e8e;
}

.field-password input {
  padding-right: 64px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 4px;
}

.toggle-password:hover {
  color: #c7c7c7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.btn-login {
  margin-top: 4px;
  background: var(--btn-login);
  color: var(--btn-login-text);
  cursor: default;
}

.btn-login.is-active {
  background: var(--btn-login-active);
  color: var(--btn-login-active-text);
  cursor: pointer;
}

.btn-login.is-active:hover {
  background: #1877f2;
}

.forgot-link {
  display: block;
  text-align: center;
  margin: 18px 0 28px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.btn-facebook {
  background: var(--btn-secondary);
  color: var(--text);
  border: 1px solid #2a2a2a;
  margin-bottom: 12px;
}

.btn-facebook:hover {
  background: #242424;
}

.fb-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-create {
  background: transparent;
  color: var(--btn-create-text);
  border: 1px solid var(--btn-create-border);
}

.btn-create:hover {
  background: rgba(0, 149, 246, 0.08);
}

.meta-brand {
  margin-top: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f5f5f5;
}

.meta-infinity {
  width: 34px;
  height: 18px;
}

.meta-word {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* ===== Footer ===== */
.footer {
  width: 100%;
  padding: 16px 24px 24px;
  text-align: center;
  border-top: 1px solid #1a1a1a;
  background: #000;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 14px;
}

.footer-links a {
  color: var(--footer);
  font-size: 12px;
  text-decoration: none;
  line-height: 1.5;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  color: var(--footer);
  font-size: 12px;
}

.lang-select select {
  background: transparent;
  border: none;
  color: var(--footer);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23a8a8a8' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

.lang-select select option {
  background: #1a1a1a;
  color: #f5f5f5;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero {
    display: none;
  }

  .auth {
    border-left: none;
    background: #0c1014;
    min-height: calc(100vh - 120px);
    padding: 40px 20px 24px;
  }

  .auth-mobile-logo,
  .auth-divider {
    display: flex;
  }

  .auth-divider {
    display: block;
  }

  .meta-brand {
    margin-top: 40px;
  }
}

@media (max-width: 450px) {
  .auth {
    align-items: flex-start;
    padding-top: 48px;
  }

  .auth-title {
    font-size: 20px;
  }
}
