/* Login Page - Orange/Black Theme with Dashboard Background */

:root {
  --bg: #0b0b0b;
  --panel: rgba(255,255,255,0.06);
  --panel-strong: rgba(255,255,255,0.12);
  --glass-stroke: rgba(255,255,255,0.18);
  --txt: #f6f6f6;
  --muted: #c7c7c7;
  --orange: #ff7a18;
  --orange-strong: #ff8c32;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
  --error-color: #ff5d5d;
  --success-color: #39d98a;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--txt);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* Background (from dashboard) */
.bg-mesh {
  position: fixed;
  inset: -10vmax;
  background:
    radial-gradient(40vmax 40vmax at 15% 15%, rgba(255,122,24,0.15), transparent 60%),
    radial-gradient(50vmax 50vmax at 85% 25%, rgba(255,122,24,0.08), transparent 60%),
    radial-gradient(55vmax 55vmax at 50% 90%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(180deg, #0b0b0b 0%, #0a0a0a 100%);
  filter: saturate(1.1);
  z-index: -3;
  animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-2vh); }
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0/40px 40px;
  mask-image: radial-gradient(80% 60% at 50% 40%, rgba(0,0,0,0.9), transparent 80%);
  pointer-events: none;
}

.orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: absolute;
  width: 28vmax;
  height: 28vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,122,24,0.20), rgba(255,122,24,0) 70%);
  filter: blur(30px);
  animation: float 14s ease-in-out infinite;
}

.o1 { top: 10%; left: -8%; animation-delay: -2s; }
.o2 { bottom: -10%; right: -6%; animation-duration: 18s; }
.o3 { top: 55%; left: 60%; width: 22vmax; height: 22vmax; animation-duration: 16s; }

@keyframes float {
  0% { transform: translate(0,0) scale(1); }
  50% { transform: translate(2vmax,-1vmax) scale(1.05); }
  100% { transform: translate(-1vmax,1vmax) scale(1); }
}

/* Container */
.container {
  width: min(1000px, 92vw);
  margin-inline: auto;
}

/* Header */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0;
  position: relative;
  z-index: 100;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--txt);
}

.logo {
  height: 100px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}

/* Main Container */
.auth-container {
  flex: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  width: 100%;
}

/* Auth Card */
.auth-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 2.5rem 2.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.4s ease-out;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--orange);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.8;
}

/* Header Content */
.auth-header-content {
  margin-bottom: 2rem;
}

.auth-header-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-header-content .subtitle {
  font-size: 0.9375rem;
  color: #6b7280;
  line-height: 1.5;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  background: #ffffff;
  color: #1a1a1a;
  transition: all 0.2s;
}

.form-group input::placeholder {
  color: #9ca3af;
}

.form-group input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.1);
}

/* Password Input with Toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: #6b7280;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* Form Footer */
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--orange);
  border-color: var(--orange);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.forgot-link {
  font-size: 0.875rem;
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.forgot-link:hover {
  opacity: 0.8;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: var(--orange-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 122, 24, 0.3);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Terms */
.terms {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #9ca3af;
  line-height: 1.5;
}

.terms a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.terms a:hover {
  text-decoration: underline;
}

/* Auth Footer */
.auth-footer {
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  margin-left: 0.25rem;
}

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

/* Testimonial (Quote at bottom) */
.testimonial {
  max-width: 600px;
  text-align: center;
  color: var(--txt);
  padding: 0 1rem;
}

.testimonial-quote {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.author-info {
  text-align: left;
}

.author-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 0.125rem;
}

.author-title {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Error/Success Messages */
.error-line {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.error-line.error {
  background: rgba(255, 93, 93, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(255, 93, 93, 0.2);
  display: block;
}

.error-line.success {
  background: rgba(57, 217, 138, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(57, 217, 138, 0.2);
  display: block;
}

.success-icon {
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: 700;
}

/* Loading State */
.btn-primary.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 640px) {
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .auth-header-content h1 {
    font-size: 1.75rem;
  }

  .logo {
    height: 72px;
  }

  .testimonial-quote {
    font-size: 0.9375rem;
  }

  .author-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
  }
}
