/* Auth Pages - Minimalist & Elegant */
:root {
  --white: #ffffff;
  --black: #000000;
  --primary: #ef070a;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-400: #a1a1aa;
  --gray-600: #52525b;
  --gray-900: #18181b;
}

html[data-theme="dark"] .auth-card {
  background: #1a1f27;
  border: 1px solid var(--gray-200);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .auth-card::before {
  background: var(--primary);
}

.auth-body {
  font-family: "Inter", sans-serif;
  background: var(--white);
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  line-height: 1.5;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.auth-card {
  background: var(--white);
  padding: 2.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-100);
  position: relative;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: var(--primary);
  border-radius: 0 0 2px 2px;
}

/* Logo & Header */
.auth-logo-container {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-container img {
  height: 48px;
  width: auto;
  margin-bottom: 1rem;
}
html[data-theme="dark"] .auth-logo-container img {
  filter: brightness(0) saturate(100%) invert(1);
}

html[data-theme="dark"] .btn-auth {
  color: var(--black);
}

.auth-logo-container h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.auth-logo-container p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--white);
  color: var(--black);
  width: 100%;
}

.form-group input::placeholder {
  color: var(--gray-400);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(239, 7, 10, 0.1);
}

/* Responsive Design untuk Form Rows */
@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .auth-body {
    padding: 0.75rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 8px;
  }

  .auth-card::before {
    left: 1.5rem;
    right: 1.5rem;
  }

  .auth-logo-container img {
    height: 40px;
  }

  .auth-logo-container h2 {
    font-size: 1.375rem;
  }
}

/* Buttons */
.btn-auth {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.btn-auth:hover {
  box-shadow: 0 4px 12px rgba(239, 7, 10, 0.25);
}

.btn-auth:active {
  transform: none;
}

.btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Messages */
.error-message {
  background: rgba(239, 7, 10, 0.05);
  color: var(--primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  border: 1px solid rgba(239, 7, 10, 0.2);
  text-align: center;
}

.success-message {
  background: rgba(0, 128, 0, 0.05);
  color: #059669;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  border: 1px solid rgba(0, 128, 0, 0.2);
  text-align: center;
}

/* Auth Link */
.auth-link {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
  font-size: 0.875rem;
  color: var(--gray-600);
}

.auth-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-link a:hover {
  color: var(--black);
}

/* Responsive Design */
@media (max-width: 480px) {
  .auth-body {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 8px;
  }

  .auth-card::before {
    left: 1.5rem;
    right: 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 1rem;
  }

  .auth-logo-container img {
    height: 40px;
  }

  .auth-logo-container h2 {
    font-size: 1.2rem;
  }
}

@media (max-width: 359px) {
  .auth-card {
    padding: 1.5rem 1.25rem;
  }

  .auth-card::before {
    left: 1.25rem;
    right: 1.25rem;
  }
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card {
  animation: fadeInUp 0.5s ease-out;
}

/* Focus states for accessibility */
.form-group input:focus-visible,
.form-group select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.btn-auth:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.auth-link a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-radius: 2px;
}

/* Loading state */
.btn-auth.loading {
  pointer-events: none;
  opacity: 0.8;
  position: relative;
}

.btn-auth.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Field error states */
.field-error-message {
  color: var(--primary);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}
