/* ============================================================
   SpoxHub – Login Page Styles
   Design System: SpoxHub v1.0 (Dark · Neon · Urban)
   ============================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--color-bg-base);
  color: var(--color-text-primary);
  overscroll-behavior: none;
}

/* ── BACKGROUND GLOW ── */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(
    ellipse at center,
    rgba(72, 69, 199, 0.12) 0%,
    rgba(0, 255, 212, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── PAGE ── */
.page {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ── LOGIN CARD ── */
.login-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeUp 0.35s ease forwards;
}

/* ── LOGO ── */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.logo-icon {
  height: 34px;
  width: auto;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.025em;
}

.logo-text span {
  color: var(--color-neon-400);
}

.logo-tagline {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 0.35rem;
}

.logo-tagline .accent {
  color: var(--color-neon-400);
  text-shadow: 0 0 20px rgba(0, 255, 212, 0.5), 0 0 40px rgba(0, 255, 212, 0.2);
}

.logo-tagline .accent-dim {
  color: var(--color-brand-300);
  text-shadow: 0 0 16px rgba(110, 94, 255, 0.4);
}

/* ── FORM CARD ── */
.form-card {
  width: 100%;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-bg-border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4), 0 -1px 0 rgba(0, 255, 212, 0.15) inset;
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 255, 212, 0.5) 50%, transparent 100%);
}

.form-header {
  margin-bottom: 1.75rem;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.form-subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.2rem;
}

/* ── FIELDS ── */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-group label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-bg-border);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  outline: none;
  -webkit-appearance: none;
}

.field-group input:focus {
  border-color: var(--color-neon-400);
  background: #161628;
  box-shadow: 0 0 0 3px rgba(0, 255, 212, 0.1);
}

.field-group input::placeholder {
  color: var(--color-text-tertiary);
}

/* ── ERROR ── */
.login-error {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(255, 51, 102, 0.1);
  color: var(--color-error);
  border-left: 3px solid var(--color-error);
}

.login-error.visible {
  display: block;
}

/* ── SUBMIT BUTTON ── */
.btn-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  margin-top: 0.25rem;
  border: 2px solid var(--color-neon-400);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--color-neon-400);
  color: #07070F;
  box-shadow: 0 0 16px rgba(0, 255, 212, 0.25);
  transition: background 150ms ease, box-shadow 150ms ease, transform 100ms ease, border-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:hover:not(:disabled) {
  background: #38FFD8;
  border-color: #38FFD8;
  box-shadow: 0 0 28px rgba(0, 255, 212, 0.4);
  transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(7, 7, 15, 0.3);
  border-top-color: #07070F;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-submit.loading .btn-label { display: none; }
.btn-submit.loading .btn-spinner { display: inline-block; }

/* ── DIVIDER ── */
.form-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-bg-border);
}

.form-divider span {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ── APP LINKS ── */
.app-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.app-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-bg-border);
  border-radius: 8px;
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.app-link:hover {
  border-color: rgba(0, 255, 212, 0.3);
  background: rgba(0, 255, 212, 0.04);
  color: var(--color-text-primary);
}

.app-link-icon {
  width: 32px;
  height: 32px;
  background: rgba(0, 255, 212, 0.07);
  border: 1px solid rgba(0, 255, 212, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-link-icon svg {
  width: 16px;
  height: 16px;
  color: var(--color-neon-400);
}

.app-link-info {
  flex: 1;
  min-width: 0;
}

.app-link-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: 0.875rem;
}

.app-link-desc {
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
  margin-top: 0.1rem;
}

.app-link-arrow {
  width: 16px;
  height: 16px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

/* ── FORGOT / BACK ── */
.forgot-wrap {
  margin-top: 1rem;
  text-align: center;
}

.btn-forgot {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  padding: 0.25rem 0;
  transition: color 150ms ease;
}

.btn-forgot:hover {
  color: var(--color-neon-400);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  padding: 0;
  transition: color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-back svg {
  width: 16px;
  height: 16px;
}

.btn-back:hover {
  color: var(--color-text-primary);
}

/* ── RESET SUCCESS ── */
.reset-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
}

.temp-pw-hint {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  text-align: center;
  line-height: 1.5;
  margin-top: -0.25rem;
}

/* ── FOOTER ── */
.page-footer {
  margin-top: 2rem;
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ── SUCCESS STATE ── */
.success-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 2.5rem 2rem;
}

.success-screen.visible {
  display: flex;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: rgba(0, 255, 212, 0.1);
  border: 1.5px solid rgba(0, 255, 212, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0, 255, 212, 0.2);
  animation: popIn 0.3s var(--ease-bounce, cubic-bezier(0.34,1.56,0.64,1)) forwards;
}

.success-icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-neon-400);
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.success-name {
  color: var(--color-neon-400);
}

.success-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: -1rem;
}

.success-apps {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  text-align: left;
}

.success-apps-label {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ── ANIMATIONS ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes fadeUp {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-base); }
::-webkit-scrollbar-thumb { background: var(--color-bg-muted); border-radius: 999px; }

::selection {
  background: rgba(0, 255, 212, 0.2);
  color: var(--color-text-primary);
}
