/* ========================================
   THEME VARIABLES - Customize these for each site
   ======================================== */

:root {
  /* Primary Brand Colors */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  
  /* Accent Colors */
  --accent-color: #8b5cf6;
  --accent-light: #a78bfa;
  
  /* Background Colors */
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #252538;
  --bg-card: rgba(30, 30, 46, 0.8);
  --bg-overlay: rgba(15, 15, 26, 0.95);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-link: var(--primary-light);
  
  /* Input Colors */
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus-border: var(--primary-color);
  --input-focus-shadow: rgba(99, 102, 241, 0.2);
  
  /* Status Colors */
  --error-color: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.3);
  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.3);
  
  /* Shadows & Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

/* ========================================
   ALTERNATIVE THEME EXAMPLES
   Uncomment to use different color schemes
   ======================================== */

/* THEME: Ocean Blue
:root {
  --primary-color: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-light: #38bdf8;
  --accent-color: #06b6d4;
}
*/

/* THEME: Forest Green
:root {
  --primary-color: #10b981;
  --primary-hover: #059669;
  --primary-light: #34d399;
  --accent-color: #14b8a6;
}
*/

/* THEME: Sunset Orange
:root {
  --primary-color: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #fb923c;
  --accent-color: #f59e0b;
}
*/

/* THEME: Royal Purple
:root {
  --primary-color: #9333ea;
  --primary-hover: #7e22ce;
  --primary-light: #a855f7;
  --accent-color: #c026d3;
}
*/

/* THEME: Crimson Red
:root {
  --primary-color: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: #ef4444;
  --accent-color: #f43f5e;
}
*/

/* ========================================
   BASE STYLES
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ========================================
   AUTH PAGE LAYOUT
   ======================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.auth-container {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 2;
}

.auth-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-box-register {
  max-width: 580px;
  margin: 0 auto;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   HEADER
   ======================================== */

.auth-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.logo-placeholder {
  display: inline-flex;
  margin-bottom: var(--spacing-md);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ========================================
   ERROR MESSAGE
   ======================================== */

.error-message {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--error-color);
  font-size: 14px;
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.error-message svg {
  flex-shrink: 0;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ========================================
   FORM STYLES
   ======================================== */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 2px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  transition: all var(--transition-base);
}

.input-icon {
  position: absolute;
  left: var(--spacing-md);
  color: var(--text-tertiary);
  pointer-events: none;
  transition: all var(--transition-base);
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 46px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition-base);
  outline: none;
}

.input-wrapper input::placeholder {
  color: var(--text-tertiary);
}

.input-wrapper input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

.input-wrapper.focused .input-icon {
  color: var(--primary-color);
  transform: scale(1.1);
}

.input-wrapper.valid {
  border-color: var(--success-border);
}

.input-wrapper.valid input {
  border-color: var(--success-color);
}

.input-wrapper.invalid {
  border-color: var(--error-border);
}

.input-wrapper.invalid input {
  border-color: var(--error-color);
}

.field-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-left: 2px;
}

/* ========================================
   CAPTCHA
   ======================================== */

.captcha-wrapper {
  display: flex;
  justify-content: center;
  padding: var(--spacing-sm) 0;
}

.h-captcha {
  transform-origin: center;
  animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
  position: relative;
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  transition: all var(--transition-base);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--accent-color) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary span,
.btn-primary .btn-arrow {
  position: relative;
  z-index: 1;
}

.btn-arrow {
  transition: transform var(--transition-base);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-primary.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-primary.loading .btn-arrow {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   FOOTER
   ======================================== */

.auth-footer {
  text-align: center;
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-footer p {
  color: var(--text-secondary);
  font-size: 14px;
}

.link-primary {
  color: var(--text-link);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color var(--transition-base);
}

.link-primary::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-base);
}

.link-primary:hover {
  color: var(--primary-color);
}

.link-primary:hover::after {
  width: 100%;
}

/* ========================================
   ANIMATED BACKGROUND
   ======================================== */

.auth-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-gradient-1,
.bg-gradient-2 {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: float-rotate 20s ease-in-out infinite;
}

.bg-gradient-1 {
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation-delay: 0s;
}

.bg-gradient-2 {
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
  bottom: -300px;
  left: -300px;
  animation-delay: -10s;
  animation-duration: 25s;
}

@keyframes float-rotate {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(50px, -50px) rotate(120deg);
  }
  66% {
    transform: translate(-50px, 50px) rotate(240deg);
  }
}

.bg-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
  animation: pattern-shift 30s ease-in-out infinite;
}

@keyframes pattern-shift {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .auth-container {
    max-width: 100%;
  }
  
  .auth-box {
    padding: var(--spacing-lg);
  }
  
  .auth-box-register {
    max-width: 100%;
  }
  
  .auth-header h1 {
    font-size: 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .auth-page {
    padding: var(--spacing-md);
  }
  
  .bg-gradient-1,
  .bg-gradient-2 {
    width: 600px;
    height: 600px;
  }
}

@media (max-width: 480px) {
  .auth-box {
    padding: var(--spacing-md);
  }
  
  .auth-header {
    margin-bottom: var(--spacing-lg);
  }
  
  .auth-header h1 {
    font-size: 22px;
  }
  
  .subtitle {
    font-size: 14px;
  }
  
  .input-wrapper input {
    padding: 11px var(--spacing-sm) 11px 42px;
    font-size: 14px;
  }
  
  .input-icon {
    left: 12px;
    width: 18px;
    height: 18px;
  }
  
  .btn-primary {
    padding: 13px var(--spacing-md);
    font-size: 15px;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .logo-placeholder {
    animation: none;
  }
  
  .bg-gradient-1,
  .bg-gradient-2,
  .bg-pattern {
    animation: none;
  }
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ========================================
   LOADING STATES
   ======================================== */

.input-wrapper.loading::after {
  content: '';
  position: absolute;
  right: var(--spacing-md);
  width: 16px;
  height: 16px;
  border: 2px solid var(--input-border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .auth-background {
    display: none;
  }
  
  .auth-box {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ========================================
   CUSTOM SCROLLBAR (for forms with overflow)
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */

@media (prefers-contrast: high) {
  .auth-box {
    border: 2px solid var(--text-primary);
  }
  
  .input-wrapper input {
    border: 2px solid var(--text-primary);
  }
  
  .btn-primary {
    border: 2px solid var(--text-primary);
  }
}