/* Modern & Elegant Auth Styles */
:root {
  /* Brand Colors */
  --brand-primary: #0066ff;
  --brand-secondary: #00d1ff;
  --brand-accent: #6366f1;

  /* Gradient Palettes */
  --gradient-primary: linear-gradient(135deg, #0066ff 0%, #00d1ff 100%);
  --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-accent: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);

  /* UI Colors */
  --ui-white: #ffffff;
  --ui-light: #f8fafc;
  --ui-background: #f1f5f9;
  --ui-border: #e2e8f0;

  /* Text Colors */
  --text-dark: #0f172a;
  --text-medium: #334155;
  --text-light: #64748b;
  --text-white: #ffffff;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
}

/* Base Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: "Plus Jakarta Sans", sans-serif;
  background: var(--gradient-primary);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Main Container */
.auth-container {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Decorative Elements */
.auth-container::before,
.auth-container::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  z-index: 0;
}

.auth-container::before {
  background: var(--gradient-secondary);
  top: -200px;
  right: -200px;
  filter: blur(80px);
  opacity: 0.2;
  animation: float 8s ease-in-out infinite;
}

.auth-container::after {
  background: var(--gradient-accent);
  bottom: -200px;
  left: -200px;
  filter: blur(80px);
  opacity: 0.2;
  animation: float 8s ease-in-out infinite reverse;
}

/* Welcome Section */
.auth-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl) var(--space-md);
  position: relative;
  z-index: 1;
}

.welcome-content {
  text-align: center;
  max-width: 480px;
}

.auth-logo {
  margin-bottom: var(--space-lg);
  position: relative;
}

.auth-logo img {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
  animation: logoFloat 6s ease-in-out infinite;
}

.auth-logo::after {
  content: "";
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  animation: pulse 4s ease-in-out infinite;
}

.welcome-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--ui-white);
  text-align: center;
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.welcome-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

/* Form Container */
.auth-form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-md);
  position: relative;
  z-index: 1;
}

.form-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: var(--space-xl);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  animation: slideUp 1s ease-out forwards;
}

.form-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--space-xs);
}

.form-subtitle {
  font-size: 1rem;
  color: var(--text-light);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: var(--space-xs);
}

.input-group {
  position: relative;
}

.form-control {
  width: 100%;
  height: 58px;
  padding: 0 var(--space-lg) 0 3.25rem;
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--ui-white);
  border: 2px solid var(--ui-border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
  background: var(--ui-white);
  outline: none;
}

.input-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.375rem;
  color: var(--text-light);
  pointer-events: none;
  transition: all 0.3s ease;
}

.form-control:focus + .input-icon {
  color: var(--brand-primary);
}

.password-toggle {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.password-toggle:hover {
  background: var(--ui-background);
  color: var(--text-medium);
}

/* Button */
.auth-btn {
  width: 100%;
  height: 58px;
  margin-top: var(--space-lg);
  background: var(--gradient-primary);
  color: var(--ui-white);
  border: none;
  border-radius: 16px;
  font-size: 1.0625rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 102, 255, 0.2),
    0 8px 12px rgba(0, 102, 255, 0.1);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 102, 255, 0.25),
    0 12px 16px rgba(0, 102, 255, 0.15);
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 102, 255, 0.2), 0 4px 8px rgba(0, 102, 255, 0.1);
}

.auth-btn .bi {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.auth-btn:hover .bi {
  transform: translateX(4px);
}

/* Form Footer */
.form-footer {
  margin-top: var(--space-lg);
  text-align: center;
}

.copyright {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Alert */
.auth-alert {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: #dc2626;
  font-size: 0.9375rem;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1),
    0 4px 6px rgba(220, 38, 38, 0.05);
  animation: shake 0.5s ease-in-out;
}

/* Loading State */
.auth-btn.loading {
  background: var(--gradient-primary);
  cursor: not-allowed;
}

.auth-btn.loading .bi.spinning {
  animation: spin 1s linear infinite;
}

/* Animations */
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(0, 30px);
  }
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Desktop Styles */
@media (min-width: 992px) {
  .auth-container {
    flex-direction: row;
    max-width: 1080px;
    margin: 2rem auto;
    min-height: calc(100vh - 4rem);
    border-radius: 32px;
    background: var(--ui-white);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
  }

  .auth-welcome {
    flex: 1;
    width: 50%;
    padding: calc(var(--space-xl) * 1.5);
    background: var(--gradient-primary);
    border-radius: 24px 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-form-container {
    flex: 1;
    width: 50%;
    padding: calc(var(--space-xl) * 1.5);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .form-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    box-shadow: none;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .welcome-content {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
    padding: 0 var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .auth-logo {
    margin-bottom: var(--space-xl);
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .auth-logo img {
    height: 96px;
    width: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
  }

  .auth-logo::after {
    content: "";
    position: absolute;
    width: 180%;
    height: 180%;
    top: -40%;
    left: -40%;
    background: radial-gradient(
      circle,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(255, 255, 255, 0) 70%
    );
    animation: pulse 4s ease-in-out infinite;
  }

  .form-header {
    margin-bottom: var(--space-xl);
    text-align: left;
  }

  .form-title {
    font-size: 2rem;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
  }

  .form-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    letter-spacing: -0.01em;
  }

  .welcome-title {
    font-size: 2.25rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
    text-align: center;
    max-width: 380px;
    margin: 0 auto;
  }

  .welcome-subtitle {
    font-size: 1.125rem;
    line-height: 1.5;
    margin-top: var(--space-sm);
    text-align: center;
    max-width: 340px;
  }

  .form-group {
    margin-bottom: var(--space-lg);
  }

  .form-label {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--text-dark);
  }

  .form-control {
    max-width: 400px;
    height: 56px;
    font-size: 1.0625rem;
    border-width: 1.5px;
    padding: 0 var(--space-lg) 0 3.25rem;
  }

  .input-icon {
    left: var(--space-md);
    font-size: 1.25rem;
  }

  .password-toggle {
    right: var(--space-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
  }

  .auth-btn {
    max-width: 400px;
    height: 56px;
    margin-top: var(--space-xl);
    font-size: 1.0625rem;
    letter-spacing: 0.01em;
  }

  .auth-btn .bi {
    font-size: 1.25rem;
    margin-left: var(--space-xs);
  }

  .form-footer {
    margin-top: var(--space-xl);
  }

  .copyright {
    font-size: 0.9375rem;
    color: var(--text-medium);
  }

  /* Alert styling for desktop */
  .auth-alert {
    max-width: 400px;
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    border-radius: 16px;
    font-size: 1rem;
  }

  .auth-alert .bi {
    font-size: 1.25rem;
  }
}

/* Additional size optimization for larger screens */
@media (min-width: 1200px) {
  .auth-container {
    max-width: 1140px;
  }

  .auth-welcome,
  .auth-form-container {
    padding: calc(var(--space-xl) * 2);
  }

  .welcome-content,
  .form-card {
    max-width: 460px;
  }

  .auth-logo img {
    height: 108px;
  }
}

/* Mobile Optimizations */
@media (max-width: 575px) {
  :root {
    --space-xl: 2rem;
    --space-lg: 1.5rem;
    --space-md: 1.25rem;
  }

  .auth-welcome {
    padding: var(--space-lg) var(--space-md);
  }

  .auth-logo img {
    height: 64px;
  }

  .welcome-title {
    font-size: 1.75rem;
    padding: 0 var(--space-sm);
  }

  .welcome-subtitle {
    font-size: 1rem;
    padding: 0 var(--space-md);
  }

  .form-card {
    padding: var(--space-lg);
    border-radius: 24px;
    margin-bottom: var(--space-md);
  }

  .form-title {
    font-size: 1.5rem;
  }

  .form-control,
  .auth-btn {
    height: 54px;
  }

  .form-control {
    font-size: 1rem;
    padding: 0 var(--space-md) 0 3rem;
  }

  .input-icon {
    font-size: 1.25rem;
    left: var(--space-sm);
  }

  .password-toggle {
    right: var(--space-sm);
  }
}

/* Extra Small Screen */
@media (max-width: 360px) {
  .auth-welcome {
    padding: var(--space-md) var(--space-sm);
  }

  .auth-logo img {
    height: 56px;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .form-card {
    padding: var(--space-md);
  }

  .form-control,
  .auth-btn {
    height: 50px;
    border-radius: 12px;
  }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }

  .form-control {
    font-size: 16px !important;
  }
}
