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

:root {
  --bg: #fafafa;
  --white: #fff;
  --border: #dbdbdb;
  --text: #262626;
  --sub: #8e8e8e;
  --blue: #0095f6;
  --blue-dark: #00376b;
  --error: #ed4956;
}

body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* PAGE WRAP */
.page-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  padding: 40px 20px 20px;
}

/* ===================== PHONE MOCKUP ===================== */
.phone-side {
  display: none;
}

@media (min-width: 768px) {
  .phone-side { display: flex; align-items: center; justify-content: center; }
}

.phone-frame {
  width: 250px;
  height: 500px;
  border-radius: 36px;
  border: 8px solid #222;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  overflow: hidden;
  position: relative;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #fafafa;
  overflow: hidden;
  position: relative;
}

.phone-notch {
  width: 90px;
  height: 18px;
  background: #222;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 8px;
}

.phone-content {
  padding: 0 0 8px;
  overflow: hidden;
}

/* Phone stories */
.phone-stories {
  display: flex;
  gap: 8px;
  padding: 4px 10px 10px;
  overflow: hidden;
}

.phone-story {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid transparent;
  background-origin: border-box;
  background-clip: content-box, border-box;
}

.s1 {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) border-box;
  background-color: #d0a876;
  background-image:
    url('https://i.pravatar.cc/52?img=5'),
    linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  background-size: cover, cover;
}

.s2 {
  background-color: #a8c4e0;
  background-image: url('https://i.pravatar.cc/52?img=9');
  background-size: cover;
  border-color: #dc2743;
}

.s3 {
  background-color: #c4b5d0;
  background-image: url('https://i.pravatar.cc/52?img=11');
  background-size: cover;
  border-color: #f09433;
}

/* Phone post */
.phone-post {
  background: #fff;
  margin-bottom: 8px;
}

.phone-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.phone-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.a1 { background: url('https://i.pravatar.cc/28?img=7') center/cover; }
.a2 { background: url('https://i.pravatar.cc/28?img=13') center/cover; }

.phone-post-meta { flex: 1; display: flex; flex-direction: column; gap: 3px; }

.phone-line {
  height: 6px;
  background: #efefef;
  border-radius: 4px;
}
.phone-line.short { width: 70px; }
.phone-line.shorter { width: 45px; }
.phone-line.long { width: 130px; }

.phone-post-img {
  width: 100%;
  height: 150px;
}

.pi1 {
  background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&q=70') center/cover;
}

.pi2 {
  background: url('https://images.unsplash.com/photo-1519125323398-675f0ddb6308?w=300&q=70') center/cover;
  height: 120px;
}

.phone-post-actions {
  padding: 6px 10px 4px;
}

.phone-action-icons {
  display: flex;
  gap: 10px;
  font-size: 16px;
}

/* ===================== FORMS ===================== */
.forms-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 350px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 100%;
  padding: 40px 40px 24px;
  text-align: center;
}

.card-small {
  padding: 18px 40px;
  font-size: 14px;
  color: var(--sub);
}

.insta-logo {
  font-family: 'Dancing Script', cursive;
  font-size: 52px;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -1px;
}

/* FORM FIELDS */
.insta-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field-wrap {
  position: relative;
}

.field {
  width: 100%;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px 10px 2px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  height: 44px;
}

.field:focus {
  border-color: #aaa;
}

.field.error-field {
  border-color: var(--error);
}

.field-label {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--sub);
  pointer-events: none;
  transition: top 0.12s, font-size 0.12s, transform 0.12s;
}

.field:not(:placeholder-shown) ~ .field-label,
.field:focus ~ .field-label {
  top: 8px;
  font-size: 10px;
  transform: none;
}

.show-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

/* BUTTONS */
.btn-primary {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.15s, background 0.15s;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { background: #b2dffc; cursor: default; opacity: 1; }

.btn-facebook {
  background: none;
  border: none;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 4px 0;
  transition: opacity 0.15s;
}

.btn-facebook:hover { opacity: 0.7; }

/* OR */
.or-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0;
}

.or-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.or-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 1px;
}

.forgot-link {
  display: block;
  margin-top: 18px;
  font-size: 12px;
  color: var(--blue-dark);
  text-decoration: none;
}

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

.link-blue {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

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

/* APP BADGES */
.app-badges {
  text-align: center;
  margin-top: 10px;
}

.app-badges p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
}

.badges-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.badge {
  height: 40px;
  border-radius: 8px;
}

/* FOOTER */
.site-footer {
  padding: 20px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-bottom: 16px;
}

.footer-links a {
  font-size: 12px;
  color: var(--sub);
  text-decoration: none;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.lang-select {
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12px;
  color: var(--sub);
  padding: 4px 8px;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.footer-bottom span {
  font-size: 12px;
  color: var(--sub);
}

/* SPINNER */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

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

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ERROR MESSAGE */
.error-msg {
  font-size: 12px;
  color: var(--error);
  text-align: center;
  margin-top: 4px;
  display: none;
}

.error-msg.visible { display: block; }

.insta-logo-img {
  width: 175px;
  margin-bottom: 28px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
