/* =========================================================
   GUYS WHO FIT — Auth & Profile Styles (auth.css)
   Uses the same design tokens from styles.css.
   Loaded on every public page that loads auth.js.
   ========================================================= */

/* ── Auth Modal Overlay ──────────────────────────────────── */
.gtl-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 9000;
  animation: gtlAuthFadeIn 0.2s var(--ease) both;
}
.gtl-auth-overlay.is-closing {
  animation: gtlAuthFadeOut 0.22s var(--ease) both;
}
@keyframes gtlAuthFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes gtlAuthFadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ── Auth Modal Box ──────────────────────────────────────── */
.gtl-auth-modal {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: var(--space-xl) var(--space-xl);
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
  animation: gtlAuthSlideUp 0.25s 0.04s var(--ease) both;
}
.gtl-auth-overlay.is-closing .gtl-auth-modal {
  animation: gtlAuthSlideDown 0.22s var(--ease) both;
}
@keyframes gtlAuthSlideUp   { from { transform: translateY(20px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes gtlAuthSlideDown { from { transform: translateY(0);   opacity: 1; } to { transform: translateY(16px); opacity: 0; } }

/* ── Close button ────────────────────────────────────────── */
.gtl-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
  cursor: pointer;
}
.gtl-auth-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Brand ───────────────────────────────────────────────── */
.gtl-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-md);
}
.gtl-auth-brand .logo-mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text-primary);
}
.gtl-auth-brand .logo-mark img.gtl-logo-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.gtl-auth-brand .logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.07em;
  color: var(--text-primary);
}

/* ── Heading & subheading ────────────────────────────────── */
.gtl-auth-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
  line-height: 1.3;
}
.gtl-auth-subheading {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg);
}

/* ── Google button ───────────────────────────────────────── */
.gtl-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.gtl-google-btn:hover {
  border-color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.gtl-google-btn:active {
  background: var(--bg);
}

/* ── Removed: tabs (.gtl-auth-tabs, .gtl-auth-tab, .gtl-auth-panel) ── */

/* ── Form fields ─────────────────────────────────────────── */
.gtl-auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.gtl-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gtl-auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.gtl-auth-field input {
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.gtl-auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}
.gtl-auth-field input::placeholder {
  color: var(--text-secondary);
}

/* Submit button spinner */
.gtl-auth-submit {
  margin-top: 4px;
  position: relative;
  min-height: 48px;
}
.gtl-auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gtlSpin 0.7s linear infinite;
  display: inline-block;
}
@keyframes gtlSpin { to { transform: rotate(360deg); } }

/* ── Error / notice ──────────────────────────────────────── */
.gtl-auth-error {
  background: #FEF2F2;
  color: #DC2626;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 4px;
}
.gtl-auth-notice {
  background: #F0FDF4;
  color: #166534;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: var(--space-sm);
}
.gtl-auth-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  color: var(--text-secondary);
}

/* ── Legal ───────────────────────────────────────────────── */
.gtl-auth-legal {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: var(--space-md);
}
.gtl-auth-legal a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ── Header avatar button ────────────────────────────────── */
.gtl-auth-btn-wrap {
  display: flex;
  align-items: center;
}
.gtl-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity var(--speed-fast) var(--ease), transform var(--speed-fast) var(--ease);
  flex-shrink: 0;
}
.gtl-avatar-btn:hover {
  opacity: 0.85;
  transform: scale(1.06);
}
.gtl-avatar-initial {
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}

/* ── Profile page ────────────────────────────────────────── */
#profileMain {
  min-height: calc(100vh - var(--header-h, 76px));
}

.profile-hero {
  padding: var(--space-2xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.profile-hero-inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-avatar-lg .gtl-avatar-initial {
  font-size: 26px;
}
.profile-user-name {
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.profile-user-email {
  font-size: 14px;
  color: var(--text-secondary);
}
.profile-hero-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Profile stats bar */
.profile-stats-bar {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
}
.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-stat-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.profile-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Profile section heading */
.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.profile-section-head h2 {
  font-size: clamp(20px, 2.5vw, 26px);
}

/* Empty state */
.profile-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-secondary);
}
.profile-empty-icon {
  width: 64px;
  height: 64px;
  background: var(--bg);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}
.profile-empty h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.profile-empty p {
  font-size: 15px;
  max-width: 340px;
  margin: 0 auto var(--space-lg);
}

/* Saved outfit card unsave button */
.outfit-card-unsave {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
  z-index: 2;
  backdrop-filter: blur(4px);
}
.outfit-card-unsave:hover {
  background: #FEF2F2;
  color: #DC2626;
}
.outfit-card-media { position: relative; }

/* Profile logged-out gate */
.profile-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: var(--space-lg);
}
.profile-gate h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin-bottom: var(--space-sm);
}
.profile-gate p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 360px;
  margin: 0 auto var(--space-lg);
}
.profile-gate-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

/* Loading skeleton for profile */
.profile-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}
.profile-skeleton-card {
  border-radius: var(--radius-card);
  background: var(--border);
  height: 320px;
  animation: profilePulse 1.4s ease-in-out infinite alternate;
}
@keyframes profilePulse {
  from { opacity: 0.6; }
  to   { opacity: 1;   }
}

/* Responsive */
@media (max-width: 600px) {
  .gtl-auth-modal {
    padding: var(--space-lg) var(--space-md);
  }
  .profile-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  .profile-hero-actions {
    margin-left: 0;
    width: 100%;
  }
  .profile-hero-actions .btn {
    flex: 1;
  }
}
