/* =============================================================
   AimanFitness — Login / Auth Page
   ============================================================= */

:root {
  --bg:         #0A0712;
  --surface:    #140E24;
  --surface-2:  #1C1432;
  --primary:    #8B5CF6;
  --primary-l:  #A78BFA;
  --primary-xl: #C9B4FF;
  --accent:     #F5C518;
  --text:       #F0F0F5;
  --text-2:     #C8C8D8;
  --muted:      #8B8B9F;
  color-scheme: dark;
  --glass:      rgba(139, 92, 246, 0.08);
  --border:     rgba(139, 92, 246, 0.22);
  --border-l:   rgba(139, 92, 246, 0.45);
  --sans:    "DM Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius:  14px;
  --radius-l: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  display: flex;
  align-items: stretch;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary-l); outline-offset: 3px; border-radius: 6px; }

/* Page Layout */
.auth-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  position: relative;
  overflow: hidden;
}

/* Background mesh */
.auth-mesh {
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 50% at 20% 20%, rgba(139, 92, 246,0.40) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(139, 92, 246,0.25) 0%, transparent 55%);
  filter: blur(80px);
  animation: authDrift 20s ease-in-out infinite;
  pointer-events: none;
}
@keyframes authDrift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%       { transform: scale(1.08) rotate(4deg); }
}

/* Login Card */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 2.75rem 2rem;
  text-align: center;
}
@supports (backdrop-filter: blur(16px)) {
  .auth-card {
    background: rgba(17,17,24,0.85);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
  }
}

/* Logo */
.auth-logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 3.5rem;
  letter-spacing: -0.05em;
  margin-bottom: .25rem;
}
.auth-logo .af {
  display: inline-block; width: 84px; height: 84px; object-fit: contain;
  filter: drop-shadow(0 8px 26px rgba(139, 92, 246, 0.45));
}
.auth-logo .fitness {
  display: block;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .25em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: .8rem;
  margin-bottom: 2rem;
}
.auth-logo .fitness em { font-style: normal; color: var(--accent); }

.auth-title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}
.auth-sub {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 2.25rem;
  line-height: 1.5;
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.form-group { display: flex; flex-direction: column; gap: .45rem; }
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .03em;
}
.form-input {
  padding: .85rem 1.1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  min-height: 48px;
  font-family: var(--sans);
  width: 100%;
  transition: border-color .25s, box-shadow .25s;
  outline: none;
}
.form-input::placeholder { color: var(--muted); }
.form-input:focus {
  border-color: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(139, 92, 246,0.18);
}

.form-error {
  display: none;
  font-size: .82rem;
  color: #ff6b6b;
  padding: .7rem 1rem;
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: 10px;
  text-align: center;
  line-height: 1.4;
}
.form-error.is-visible { display: block; }

.btn-submit {
  padding: .95rem 1.5rem;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-l) 100%);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
  margin-top: .5rem;
  transition: transform .3s var(--ease-out), box-shadow .3s, opacity .2s;
  box-shadow: 0 8px 28px rgba(139, 92, 246,0.30);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(139, 92, 246,0.40); }
.btn-submit:active { transform: translateY(0); }
.btn-submit.is-loading { opacity: .7; pointer-events: none; }

.auth-admin-link {
  display: block;
  margin-top: 2rem;
  font-size: .78rem;
  color: var(--muted);
  transition: color .2s;
  text-align: center;
}
.auth-admin-link:hover { color: var(--primary-l); }

.auth-back {
  position: absolute;
  top: 1.25rem; left: 1.25rem;
  z-index: 2;
  font-size: .85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: color .2s;
}
.auth-back:hover { color: var(--text); }

html { -webkit-tap-highlight-color: transparent; }
.btn-submit { min-height: 52px; touch-action: manipulation; }
.auth-back { padding: .6rem .4rem; top: max(.8rem, env(safe-area-inset-top, 0px)); }

@media (max-width: 640px) {
  .auth-input, input, select, textarea { font-size: 16px; }
}
