/* ============================================
   Instagram-Style Auth Pages (Login & Register)
   ============================================ */

:root {
  --ig-purple: #7c3aed;
  --ig-pink: #ec4899;
  --ig-orange: #f59e0b;
  --ig-gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
  --ig-bg: #f5f7ff;
  --ig-border: #e5e7eb;
  --ig-text: #111827;
  --ig-muted: #6b7280;
  --ig-blue: #2563eb;
}

.ig-auth-body {
  background: linear-gradient(135deg, #f8faff 0%, #f3f4ff 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ig-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ====== Top Bar ====== */
.ig-auth-topbar {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229,231,235,0.8);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(15,23,42,0.04);
}

.ig-auth-topbar .brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--ig-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.ig-auth-topbar-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ig-auth-topbar-nav a {
  text-decoration: none;
  color: var(--ig-text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: all 0.2s;
}

.ig-auth-topbar-nav a:hover {
  background: #f3f4f6;
}

.ig-auth-topbar-nav a.active {
  color: var(--ig-blue);
  background: #eff6ff;
}

/* ====== Main Layout ====== */
.ig-auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

.ig-auth-container {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 980px;
  width: 100%;
}

/* ====== Left Panel (Phone Mockup) ====== */
.ig-auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.ig-auth-phone {
  width: 280px;
  height: 500px;
  background: var(--ig-gradient);
  border-radius: 36px;
  padding: 16px;
  position: relative;
  box-shadow: 0 20px 60px rgba(124,58,237,0.22);
}

.ig-auth-phone-screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ig-auth-phone-header {
  background: var(--ig-gradient);
  padding: 20px 16px 12px;
  color: #fff;
  text-align: center;
}

.ig-auth-phone-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.ig-auth-phone-header p {
  font-size: 0.72rem;
  opacity: 0.85;
  margin: 0;
}

.ig-auth-phone-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}

.ig-auth-phone-grid-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.ig-auth-phone-grid-item:nth-child(1) { background: #fce7f3; }
.ig-auth-phone-grid-item:nth-child(2) { background: #dbeafe; }
.ig-auth-phone-grid-item:nth-child(3) { background: #dcfce7; }
.ig-auth-phone-grid-item:nth-child(4) { background: #fef3c7; }
.ig-auth-phone-grid-item:nth-child(5) { background: #f5e8ff; }
.ig-auth-phone-grid-item:nth-child(6) { background: #ccfbf1; }

.ig-auth-tagline {
  text-align: center;
  max-width: 320px;
  background: rgba(255,255,255,0.75);
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.06);
}

.ig-auth-tagline h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.ig-auth-tagline p {
  font-size: 0.88rem;
  color: var(--ig-muted);
  line-height: 1.5;
  margin: 0;
}

/* ====== Right Panel (Form Card) ====== */
.ig-auth-card {
  flex: 1;
  max-width: 420px;
}

.ig-auth-card-inner {
  background: #fff;
  border: 1px solid var(--ig-border);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 16px 45px rgba(15,23,42,0.08);
}

.ig-auth-card-inner h2 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.ig-auth-card-inner .subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--ig-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

/* ====== Role Selector ====== */
.ig-role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.ig-role-tab {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid var(--ig-border);
  border-radius: 14px;
  background: #fff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ig-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.ig-role-tab:hover {
  background: #f8fafc;
}

.ig-role-tab.active {
  border-color: var(--ig-blue);
  color: var(--ig-blue);
  background: #eff6ff;
}

.ig-role-tab .tab-icon {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

/* ====== Form Inputs ====== */
.ig-form-group {
  margin-bottom: 14px;
}

.ig-form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ig-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ig-form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ig-border);
  border-radius: 14px;
  font-size: 0.92rem;
  background: #fafbff;
  color: var(--ig-text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.ig-form-input:focus {
  border-color: var(--ig-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.ig-form-input::placeholder {
  color: #9ca3af;
}

/* ====== Submit Button ====== */
.ig-btn-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ig-blue), #3b82f6);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  box-shadow: 0 10px 20px rgba(37,99,235,0.18);
}

.ig-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37,99,235,0.22);
}

.ig-btn-submit:active {
  transform: translateY(0);
}

/* ====== Link Card ====== */
.ig-auth-link-card {
  background: #fff;
  border: 1px solid var(--ig-border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-top: 16px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15,23,42,0.04);
}

.ig-auth-link-card p {
  font-size: 0.88rem;
  color: var(--ig-text);
  margin: 0;
}

.ig-auth-link-card a {
  color: var(--ig-blue);
  font-weight: 700;
  text-decoration: none;
}

.ig-auth-link-card a:hover {
  text-decoration: underline;
}

/* ====== Alert Styles ====== */
.ig-alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ig-alert-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.ig-alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.ig-alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ====== Footer ====== */
.ig-auth-footer {
  padding: 20px;
  text-align: center;
}

.ig-auth-footer p {
  font-size: 0.78rem;
  color: var(--ig-muted);
}

/* ====== Responsive ====== */
@media (max-width: 900px) {
  .ig-auth-container {
    flex-direction: column;
    gap: 20px;
  }

  .ig-auth-left {
    display: none;
  }

  .ig-auth-card {
    max-width: 460px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ig-auth-topbar {
    padding: 10px 14px;
  }

  .ig-auth-wrapper {
    padding: 16px 12px 28px;
  }

  .ig-auth-topbar .brand-name {
    font-size: 1.08rem;
  }

  .ig-auth-topbar-nav a {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .ig-auth-card-inner {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .ig-role-tabs {
    flex-wrap: wrap;
  }

  .ig-role-tab {
    flex: 1 1 calc(50% - 4px);
  }
}
