/**
 * KMC BROKER - Authentication Pages
 * Login and auth page specific styles
 */

/* ===== AUTH WRAPPER ===== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: linear-gradient(135deg,
    var(--color-primary-600) 0%,
    var(--color-primary-700) 50%,
    var(--color-primary-800) 100%);
  position: relative;
  overflow: hidden;
}

/* Background decoration */
.auth-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: var(--radius-full);
  animation: float 6s ease-in-out infinite;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: var(--radius-full);
  animation: float 8s ease-in-out infinite reverse;
}

/* ===== AUTH CONTAINER ===== */
.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  animation: fadeInUp 0.6s var(--ease-out);
}

/* ===== AUTH LOGO ===== */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-8);
}

.auth-logo__image {
  height: 72px;
  width: auto;
  margin: 0 auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
  transition: all var(--duration-base) var(--ease-out);
}

.auth-logo__image:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* ===== AUTH CARD ===== */
.auth-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-2xl);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 100%);
}

/* ===== AUTH HEADER ===== */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-header__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: white;
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
}

.auth-header__subtitle {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.8);
  font-weight: var(--font-medium);
}

/* ===== AUTH FORM ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.auth-form .kmc-input-group {
  margin-bottom: 0;
}

.auth-form .kmc-input-label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--font-medium);
}

.auth-form .kmc-input {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  transition: all var(--duration-base) var(--ease-out);
}

.auth-form .kmc-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-form .kmc-input:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.auth-form .kmc-input:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.auth-form .kmc-input-icon {
  color: rgba(255, 255, 255, 0.7);
}

.auth-form .kmc-input-error {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(239, 68, 68, 0.2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

/* ===== PASSWORD TOGGLE ===== */
.auth-password-toggle {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

.auth-password-toggle:hover {
  color: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
}

.auth-form .kmc-input-wrapper--with-toggle {
  position: relative;
}

.auth-form .kmc-input-wrapper--with-toggle .kmc-input {
  padding-right: var(--space-12);
}

/* ===== REMEMBER ME ===== */
.auth-remember {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-sm);
}

.auth-remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: white;
}

/* ===== AUTH BUTTON ===== */
.auth-button {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  background: rgba(255, 255, 255, 1);
  color: var(--color-primary-700);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15),
              0 0 30px rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.auth-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg,
    var(--color-primary-600) 0%,
    var(--color-primary-700) 100%);
  transform: translate(-50%, -50%);
  transition: width var(--duration-slow) var(--ease-out),
              height var(--duration-slow) var(--ease-out);
  z-index: 0;
}

.auth-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2),
              0 0 40px rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
  color: white;
}

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

.auth-button:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-button__text {
  position: relative;
  z-index: 2;
  display: block;
}

/* ===== AUTH FOOTER ===== */
.auth-footer {
  text-align: center;
  margin-top: var(--space-8);
}

.auth-footer__text {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-sm);
  margin: 0;
}

/* ===== ERROR ALERT ===== */
.auth-alert {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid rgba(239, 68, 68, 0.8);
  color: white;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: start;
  gap: var(--space-3);
  animation: fadeInDown var(--duration-base) var(--ease-out);
}

.auth-alert__icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
  margin-top: var(--space-1);
}

.auth-alert__content {
  flex: 1;
}

.auth-alert__list {
  list-style: disc;
  padding-left: var(--space-5);
  margin: 0;
}

.auth-alert__list li {
  margin-bottom: var(--space-1);
}

.auth-alert__list li:last-child {
  margin-bottom: 0;
}

/* ===== DARK MODE (for dark theme toggle) ===== */
[data-theme="dark"] .auth-wrapper {
  background: linear-gradient(135deg,
    var(--color-primary-800) 0%,
    var(--color-primary-900) 50%,
    #000000 100%);
}

[data-theme="dark"] .auth-button {
  color: var(--color-primary-700);
}

[data-theme="dark"] .auth-button:hover {
  color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
  .auth-wrapper {
    padding: var(--space-4);
  }

  .auth-card {
    padding: var(--space-6);
  }

  .auth-header__title {
    font-size: var(--text-2xl);
  }

  .auth-logo__image {
    height: 56px;
  }
}

/* ===== LOADING STATE ===== */
.auth-button--loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.auth-button--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--color-primary-700);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}
