/* ===== StoXLyze Sign-In - Modern Stock Analysis Theme ===== */
:root {
  --bg-dark: #0a0e17;
  --bg-card: rgba(14, 20, 32, 0.85);
  --bg-card-border: rgba(34, 197, 94, 0.15);
  --accent: #22c55e;
  --accent-dim: #16a34a;
  --accent-glow: rgba(34, 197, 94, 0.25);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --input-bg: rgba(15, 23, 42, 0.8);
  --input-border: rgba(148, 163, 184, 0.15);
  --input-focus: rgba(34, 197, 94, 0.5);
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --scrollbar-thumb: rgba(34, 197, 94, 0.4);
  --scrollbar-track: rgba(15, 23, 42, 0.5);
}

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

/* Custom scrollbar - accent green theme */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 197, 94, 0.6);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Animated Background ===== */
.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 197, 94, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 197, 94, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  bottom: -5%;
  right: -5%;
  animation-delay: -7s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.chart-lines {
  position: absolute;
  inset: 0;
  opacity: 0.08;
}

.chart-lines svg {
  width: 100%;
  height: 100%;
}

.chart-lines .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 3s ease-out forwards;
}

.line-1 { animation-delay: 0.5s; }
.line-2 { animation-delay: 1s; }
.line-3 { animation-delay: 1.5s; }

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* ===== Main Container ===== */
.sign-in-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  animation: fadeSlideUp 0.8s ease-out;
}

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

/* ===== Logo Section ===== */
.logo-section {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeSlideUp 0.8s ease-out 0.2s both;
}

.logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  color: var(--accent);
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.02); }
}

.brand-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* Beta badge */
.beta-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  vertical-align: middle;
}

.beta-badge-sm {
  margin-left: 0.4rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.6rem;
}

/* ===== Card ===== */
.card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: fadeSlideUp 0.8s ease-out 0.3s both;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.card-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 100%;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 60%);
  opacity: 0.3;
  pointer-events: none;
}

.card-content {
  position: relative;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

/* ===== Form ===== */
.signin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:hover {
  border-color: rgba(148, 163, 184, 0.25);
}

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.input-wrapper input:focus + .input-border {
  transform: scaleX(1);
}

.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.input-error {
  font-size: 0.8rem;
  color: var(--error);
  min-height: 1.2em;
}

.input-group.error input {
  border-color: var(--error);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ===== Button ===== */
.form-actions {
  margin-top: 0.5rem;
}

.btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg-dark);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* Discord sign-in button */
.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #5865F2;
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.35);
}

.btn-primary .btn-loader {
  display: none;
  gap: 4px;
}

.btn-primary.loading .btn-text {
  opacity: 0;
}

.btn-primary.loading .btn-loader {
  display: flex;
  position: absolute;
}

.btn-loader span {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  animation: dotBounce 1.4s ease-in-out infinite both;
}

.btn-loader span:nth-child(1) { animation-delay: -0.32s; }
.btn-loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ===== Form Error ===== */
.form-error {
  font-size: 0.9rem;
  color: var(--error);
  background: var(--error-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  min-height: 0;
  overflow: hidden;
  transition: var(--transition);
}

.form-error:not(:empty) {
  animation: fadeIn 0.3s ease;
}

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

/* ===== Demo Hint ===== */
.form-footer {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

.form-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  margin-top: 2rem;
  text-align: center;
  animation: fadeSlideUp 0.8s ease-out 0.4s both;
}

.footer p {
  margin-bottom: 0.25rem;
}

.cloudflare-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  opacity: 0.9;
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .sign-in-container {
    padding: 1.25rem;
  }

  .card {
    padding: 1.5rem;
  }

  .brand-name {
    font-size: 1.75rem;
  }
}
