/* ============================================
   Modern SaaS Authentication Pages
   Professional Login & Signup Design
   ============================================ */

:root {
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-500: #14b8a6;
  --primary-600: #0d9488;
  --primary-700: #0f766e;
  --accent: #0e7490;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --success: #10b981;
  --error: #dc2626;
  --shadow-sm: 0 1px 2px 0 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.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition: 200ms ease-in-out;
}

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

body {
  background: linear-gradient(135deg, #0f766e 0%, #0e7490 50%, #155e75 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  margin: 0;
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 1rem;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Animated background shapes */
body::before,
body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 20s infinite ease-in-out;
}

body::before {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

body::after {
  width: 200px;
  height: 200px;
  bottom: -50px;
  right: -50px;
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.auth-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  width: 100%;
  max-width: 420px;
  padding: 3rem 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease-out;
  margin: 0 auto;
  box-sizing: border-box;
}

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

.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0f766e, #0e7490, #155e75);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--gray-900);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0f766e, #0e7490);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-container input {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  font-size: 0.9375rem;
  transition: all var(--transition);
  background: white;
  color: var(--gray-900);
  font-family: inherit;
}

.auth-container input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.auth-container input::placeholder {
  color: var(--gray-400);
}

/* Password input wrapper */
.auth-container > div[style*="position: relative"] {
  margin-bottom: 1rem;
}

.auth-container > div[style*="position: relative"] input {
  margin-bottom: 0;
  padding-right: 3rem;
}

.auth-container .fa-eye,
.auth-container .fa-eye-slash {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--gray-500);
  transition: color var(--transition);
  z-index: 2;
}

.auth-container .fa-eye:hover,
.auth-container .fa-eye-slash:hover {
  color: var(--primary-600);
}

.auth-container button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #0f766e, #0e7490);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.auth-container button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.auth-container button:hover::before {
  width: 300px;
  height: 300px;
}

.auth-container button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #0d9488, #155e75);
}

.auth-container button:active {
  transform: translateY(0);
}

.auth-container button:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.auth-footer a {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition);
  margin-left: 0.25rem;
}

.auth-footer a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

.error-msg {
  color: var(--error);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #fef2f2;
  border-radius: var(--radius-md);
  border: 1px solid #fecaca;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.success-msg {
  color: var(--success);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #f0fdf4;
  border-radius: var(--radius-md);
  border: 1px solid #bbf7d0;
  animation: slideUp 0.3s ease-out;
}

/* Privacy & Terms consent – stays inside box on all screens */
.auth-privacy-consent {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.auth-privacy-consent__label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  cursor: pointer;
  width: 100%;
}
.auth-privacy-consent__checkbox {
  margin-top: 0.25rem;
  cursor: pointer;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
.auth-privacy-consent__text {
  min-width: 0;
  display: block;
  white-space: normal;
  writing-mode: horizontal-tb;
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.5;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: normal;
}
.auth-privacy-consent__link {
  color: var(--primary-600);
  text-decoration: underline;
}
.auth-privacy-consent__link:hover {
  color: var(--primary-700);
}
.auth-privacy-consent__required {
  color: var(--error);
}

/* Responsive Design */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }
  
  .auth-container {
    padding: 2rem 1.5rem;
    margin: 0 auto;
    max-width: calc(100% - 2rem);
  }
  
  .auth-container h2 {
    font-size: 1.75rem;
  }

  .auth-privacy-consent {
    padding: 0.875rem;
    margin-left: 0;
    margin-right: 0;
  }
  .auth-privacy-consent__text {
    font-size: 0.8125rem;
  }
}

/* Loading state */
.auth-container button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-container button:disabled:hover {
  transform: none;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}
