/* =============================================
   StreamVerse — styles.css
   Professional Glassmorphism Edition
   ============================================= */

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

:root {
  --primary:       #6c63ff;
  --primary-light: #a78bfa;
  --primary-dark:  #4f46e5;
  --bg:            #0a0a0f;
  --text:          #ffffff;
  --text-muted:    #a1a1aa;
  --success:       #34d399;
  --warning:       #fbbf24;
  --danger:        #f87171;
  --radius:        16px;
  --radius-sm:     10px;
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg:      rgba(20, 20, 30, 0.45);
  --glass-border:  rgba(255, 255, 255, 0.08);
  --glass-shadow:  0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

html, body {
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated Gradient Background ── */
.background-anim {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: radial-gradient(circle at 15% 50%, rgba(108, 99, 255, 0.15), transparent 50%),
              radial-gradient(circle at 85% 30%, rgba(167, 139, 250, 0.1), transparent 50%),
              linear-gradient(135deg, #0d0b1a 0%, #15122e 100%);
  animation: bgShift 15s ease infinite alternate;
}

@keyframes bgShift {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* ── Layout ── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.25rem 3rem;
}

.container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* ── Glassmorphism Utility ── */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── Form Inputs (Glass) ── */
.input-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.glass-input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.glass-input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.action-text-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition);
}

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

/* ── Logo / Brand ── */
.logo {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg, #ffffff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.logo-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ── Profile Section ── */
.profile-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

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

.profile-name {
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.profile-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  background: rgba(108, 99, 255, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(108, 99, 255, 0.3);
  white-space: nowrap;
}

/* ── Section Headings ── */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.75rem 0 0.85rem;
  padding-left: 0.25rem;
}

/* ── Reward Card (hero) ── */
.hero-icon {
  width: 48px;
  height: 48px;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.reward-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.reward-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  font-family: inherit;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-primary:hover { 
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4); 
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(108, 99, 255, 0.05);
  border: 1px solid rgba(108, 99, 255, 0.4);
  color: var(--primary-light);
}
.btn-outline:hover { 
  background: rgba(108, 99, 255, 0.15); 
  border-color: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { 
  color: var(--text); 
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.5);
}

/* Loading spinner inside button */
.btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Status Banner ── */
.status-banner {
  padding: 0.9rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
}
.status-banner .icon { 
  flex-shrink: 0; 
  display: flex;
  align-items: center;
}

.status-banner.info    { background: rgba(108, 99, 255, 0.1); border-left: 3px solid var(--primary-light); color: #c7c2ff; }
.status-banner.success { background: rgba(52, 211, 153, 0.1);  border-left: 3px solid var(--success);  color: #a7f3d0; }
.status-banner.warning { background: rgba(251, 191, 36, 0.1); border-left: 3px solid var(--warning); color: #fde68a; }
.status-banner.error   { background: rgba(248, 113, 113, 0.1);  border-left: 3px solid var(--danger);  color: #fecaca; }

/* ── Loading ── */
.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.spinner-lg {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.divider:not(:empty)::before { margin-right: .75em; }
.divider:not(:empty)::after { margin-left: .75em; }

/* ── Footer ── */
.page-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
}

/* ── Utility ── */
.text-center  { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

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

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

#stateSignIn, #stateMagicSent, #stateResetPassword, #stateProfile {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Responsive ── */
@media (min-width: 520px) {
  .page { padding: 3rem 1.5rem 4rem; }
  .logo { font-size: 2.5rem; }
}
