/* ============================================
   INSTAGRAM CLONE - styles.css
   ============================================ */

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

:root {
  --ig-blue: #0095f6;
  --ig-blue-hover: #1877f2;
  --ig-blue-light: #e8f0fe;
  --ig-gray-bg: #fafafa;
  --ig-border: #dbdbdb;
  --ig-text: #262626;
  --ig-text-light: #8e8e8e;
  --ig-white: #ffffff;
  --ig-fb-blue: #385185;
  --ig-error: #ed4956;
  --ig-gradient: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d, #f56040, #f77737, #fcaf45, #ffdc80);
  --radius: 8px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--ig-gray-bg);
  color: var(--ig-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--ig-blue);
}

a:hover {
  text-decoration: underline;
}

/* ============ HIDDEN ============ */
.hidden {
  display: none !important;
}

/* ============ PAGE WRAPPER ============ */
.page-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 32px 16px 0;
  gap: 32px;
}

/* ============ LEFT PANEL / PHONE MOCKUP ============ */
.left-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 380px;
  flex-shrink: 0;
}

@media (max-width: 875px) {
  .left-panel {
    display: none;
  }
  .page-wrapper {
    justify-content: center;
  }
}

.phone-mockup-wrapper {
  position: relative;
  width: 250px;
  height: 540px;
}

.phone-outer {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 460px;
  background: #fff;
  border-radius: 38px;
  border: 8px solid #1a1a1a;
  box-shadow:
    inset 0 0 0 2px #3a3a3a,
    0 30px 60px rgba(0,0,0,0.3),
    0 10px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 2;
}

/* Phone screen notch */
.phone-outer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 22px;
  background: #1a1a1a;
  border-radius: 0 0 14px 14px;
  z-index: 10;
}

/* Side buttons */
.phone-outer::after {
  content: '';
  position: absolute;
  right: -11px;
  top: 80px;
  width: 4px;
  height: 55px;
  background: #1a1a1a;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 35px 0 #1a1a1a, 0 55px 0 #1a1a1a;
}

.phone-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 30px;
  background: #f9f9f9;
  padding-top: 22px;
}

/* ============ SLIDESHOW ============ */
.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============ RIGHT PANEL ============ */
.right-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 350px;
}

/* ============ AUTH BOX ============ */
.auth-box {
  width: 100%;
  background: var(--ig-white);
  border: 1px solid var(--ig-border);
  border-radius: var(--radius);
  padding: 40px 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

@media (max-width: 500px) {
  .auth-box {
    border: none;
    padding: 24px 16px;
    background: transparent;
  }
}

/* ============ INSTAGRAM LOGO ICON ============ */
.insta-logo {
  margin-top: 8px;
}

.insta-logo svg {
  width: 52px;
  height: 52px;
  display: block;
}

/* ============ INSTAGRAM WORDMARK ============ */
.insta-wordmark {
  font-family: 'Billabong', 'Grand Hotel', cursive;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -1px;
  color: var(--ig-text);
  line-height: 1;
  background: var(--ig-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Fallback to cursive style with custom font */
@import url('https://fonts.googleapis.com/css2?family=Grand+Hotel&display=swap');

/* ============ AUTH FORM ============ */
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ============ FLOATING LABEL INPUTS ============ */
.input-group {
  position: relative;
  width: 100%;
}

.auth-input {
  width: 100%;
  padding: 14px 10px 4px;
  font-size: 12px;
  font-family: inherit;
  background: var(--ig-gray-bg);
  border: 1px solid var(--ig-border);
  border-radius: 3px;
  outline: none;
  color: var(--ig-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  height: 44px;
  -webkit-appearance: none;
}

.auth-input:focus {
  border-color: #a8a8a8;
  box-shadow: none;
}

.auth-input.error {
  border-color: var(--ig-error);
}

.float-label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--ig-text-light);
  pointer-events: none;
  transition: all 0.15s ease;
  transform-origin: left top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 40px);
}

.auth-input:focus + .float-label,
.auth-input:not(:placeholder-shown) + .float-label {
  top: 8px;
  transform: translateY(0) scale(0.83);
  font-size: 10px;
  color: var(--ig-text-light);
}

/* Show/Hide password button */
.show-hide-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--ig-text);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: inherit;
  display: none;
}

.show-hide-btn.visible {
  display: block;
}

/* ============ PRIMARY BUTTON ============ */
.btn-primary {
  width: 100%;
  padding: 8px 16px;
  background: var(--ig-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.btn-primary:hover {
  background: #1877f2;
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============ FACEBOOK BUTTON ============ */
.btn-facebook {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--ig-fb-blue);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition);
}

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

/* ============ OR DIVIDER ============ */
.or-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 16px;
  margin: 8px 0;
}

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

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

/* ============ FORGOT LINK ============ */
.forgot-link {
  text-align: center;
  font-size: 12px;
  color: var(--ig-text);
  display: block;
  margin-top: 6px;
}

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

/* ============ SIGNUP PROMPT ============ */
.signup-prompt {
  width: 100%;
  background: var(--ig-white);
  border: 1px solid var(--ig-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--ig-text);
}

.signup-prompt a {
  font-weight: 600;
  color: var(--ig-blue);
}

@media (max-width: 500px) {
  .signup-prompt {
    border: none;
    background: transparent;
  }
}

/* ============ APP DOWNLOAD ============ */
.app-download {
  text-align: center;
  margin-top: 16px;
  padding-bottom: 8px;
}

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

.store-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.store-badges img {
  height: 40px;
  width: auto;
  transition: opacity var(--transition);
}

.store-badges a:hover img {
  opacity: 0.8;
}

/* ============ SIGNUP PAGE ============ */
.signup-page {
  flex-direction: column;
  align-items: center;
}

.signup-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 350px;
  gap: 10px;
}

.signup-box {
  gap: 12px;
  padding: 32px 40px 24px;
}

.signup-tagline {
  font-size: 17px;
  font-weight: 600;
  color: var(--ig-text-light);
  text-align: center;
  line-height: 1.4;
  padding: 0 12px;
}

.terms-text {
  font-size: 12px;
  color: var(--ig-text-light);
  text-align: center;
  line-height: 1.5;
}

.terms-text a {
  font-weight: 600;
  color: var(--ig-text-light);
}

.have-account-prompt {
  font-size: 14px;
  color: var(--ig-text);
  text-align: center;
  padding-top: 4px;
}

.have-account-prompt a {
  font-weight: 600;
  color: var(--ig-blue);
}

/* ============ FOOTER ============ */
.main-footer {
  padding: 32px 16px 16px;
  text-align: center;
}

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

.footer-links a {
  font-size: 12px;
  color: var(--ig-text-light);
  white-space: nowrap;
}

.footer-links a:hover {
  text-decoration: underline;
  color: var(--ig-text);
}

.footer-copy {
  font-size: 12px;
  color: var(--ig-text-light);
}

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

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

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-box {
  animation: fadeInUp 0.4s ease forwards;
}

.right-panel {
  animation: fadeInUp 0.4s ease forwards;
}

/* ============ LOADING SPINNER ============ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============ PAGE TRANSITION ============ */
.page-wrapper {
  animation: fadeInUp 0.35s ease forwards;
}

/* ============ INPUT ERROR STATE ============ */
.error-msg {
  font-size: 12px;
  color: var(--ig-error);
  margin-top: 4px;
  display: none;
}

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

/* ============ PHONE VOLUME BUTTONS ============ */
.phone-outer .vol-btn {
  position: absolute;
  left: -11px;
  top: 100px;
  width: 4px;
  height: 32px;
  background: #1a1a1a;
  border-radius: 3px 0 0 3px;
}
