/* ============================================================
   AUTH PAGES — login, register, forgot / reset password
   Standalone (no Bootstrap). Same red & black theme as style.css.
   ============================================================ */

:root {
  --red:        #E10600;
  --red-hover:  #B30500;
  --red-glow:   rgba(225, 6, 0, 0.35);
  --black:      #000;
  --panel:      rgba(10, 10, 10, 0.88);
  --surface:    #161616;
  --border:     #2A2A2A;
  --text:       #F2F2F2;
  --muted:      #A3A3A3;
  --success:    #2ECC71;
  --warning:    #F5A623;
  --font-display: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.auth-body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--black);
  line-height: 1.5;
}

a {
  color: var(--red);
  text-decoration: none;
}
a:hover {
  color: #ff3b30;
  text-decoration: underline;
}

/* ---------- BACKGROUND ----------
   No gym photo yet. Later, set the image on the body:
   <body class="auth-body" style="--auth-bg-image: url('../images/auth-bg.jpg')">  */
.auth-page {
  --auth-bg-image: none;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1rem 3rem;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.75)),
    radial-gradient(ellipse at 15% 20%, rgba(225, 6, 0, 0.30), transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(225, 6, 0, 0.22), transparent 50%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 22px),
    var(--auth-bg-image) center / cover no-repeat,
    var(--black);
}

.bg-image-tag {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  padding: 0.4rem 0.8rem;
  border: 1px dashed #555;
  border-radius: 4px;
  color: #888;
  font-size: 0.75rem;
}

.back-link {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  color: #ccc;
  font-size: 0.9rem;
}
.back-link:hover {
  color: #fff;
}
.is-demo .back-link {
  top: 2.75rem;
}

/* ---------- PANEL (outer box from the layout sketch) ---------- */
.auth-panel {
  width: 100%;
  max-width: 460px;
  padding: 1.5rem;
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}
.auth-panel--wide {
  max-width: 540px;
}

/* Gym name + logo box */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-decoration: none;
}
.auth-brand:hover {
  text-decoration: none;
  color: #fff;
}

.logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 2px dashed var(--red);
  border-radius: 6px;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-text-accent {
  color: var(--red);
}

/* Rounded form card */
.auth-card {
  padding: 2rem 1.75rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.auth-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
}
.auth-subtitle {
  margin: 0 0 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- FORM FIELDS ---------- */
.field {
  margin-bottom: 1.1rem;
}
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ddd;
}

.input-wrap {
  position: relative;
}
.input-wrap > i.input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
}

.field input {
  width: 100%;
  padding: 0.75rem 0.9rem 0.75rem 2.6rem;
  background-color: #0E0E0E;
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder {
  color: #5c5c5c;
}
.field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.field input:focus + i.input-icon,
.input-wrap:focus-within > i.input-icon {
  color: var(--red);
}
.field input.has-toggle {
  padding-right: 2.8rem;
}

.field.is-invalid input {
  border-color: #ff4d4d;
}
.field-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #ff6b6b;
}
.field.is-invalid .field-error {
  display: block;
}

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Show / hide password */
.toggle-password {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #888;
  cursor: pointer;
}
.toggle-password:hover,
.toggle-password:focus-visible {
  color: #fff;
  outline: none;
}

.forgot-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

/* Password strength meter */
.strength {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}
.strength span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background-color: #2a2a2a;
  transition: background-color 0.2s ease;
}
.strength[data-score="1"] span:nth-child(-n+1) { background-color: #ff4d4d; }
.strength[data-score="2"] span:nth-child(-n+2) { background-color: var(--warning); }
.strength[data-score="3"] span:nth-child(-n+3) { background-color: #c6d93a; }
.strength[data-score="4"] span:nth-child(-n+4) { background-color: var(--success); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  background-color: var(--red);
  border-color: var(--red);
  color: #fff;
  text-transform: uppercase;
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--red-hover);
  border-color: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--red-glow);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--red-glow);
}
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- ALERTS ---------- */
.alert {
  display: none;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid;
  font-size: 0.9rem;
}
.alert.is-visible {
  display: block;
}
.alert-error {
  background-color: rgba(255, 77, 77, 0.1);
  border-color: rgba(255, 77, 77, 0.45);
  color: #ffb3b3;
}
.alert-success {
  background-color: rgba(46, 204, 113, 0.1);
  border-color: rgba(46, 204, 113, 0.45);
  color: #a8f0c6;
}
.alert-info {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: #444;
  color: #ddd;
}

.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.4rem 1rem;
  background-color: var(--warning);
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- STATES (e.g. "check your email") ---------- */
.state-panel {
  text-align: center;
}
.state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
  border-radius: 50%;
  border: 2px solid var(--red);
  background-color: rgba(225, 6, 0, 0.12);
  color: #fff;
  font-size: 1.75rem;
}
.state-panel p {
  color: var(--muted);
}
.state-panel strong {
  color: #fff;
  word-break: break-all;
}

[hidden] {
  display: none !important;
}

/* ---------- FOOTER LINKS ---------- */
.auth-switch {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-switch a {
  font-weight: 700;
}

.auth-footnote {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: #777;
  text-align: center;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  .auth-panel {
    padding: 1rem;
  }
  .auth-card {
    padding: 1.5rem 1.1rem;
    border-radius: 18px;
  }
  .brand-text {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.5s;
  }
  .btn {
    transition: none;
  }
}
