/* Override root layout flex on login page */
body:has(.auth-screen-root) {
  display: block !important;
  height: auto !important;
  min-height: 100vh !important;
  margin: 0;
  overflow-x: hidden;
}

.auth-screen-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: auto;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #023a25 0%, #048d5a 45%, #036b45 100%);
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(199, 161, 66, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 35%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  pointer-events: none;
}

.login-page::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  top: -180px;
  left: -180px;
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (min-width: 900px) {
  .login-shell {
    grid-template-columns: 1.05fr 1fr;
    min-height: 580px;
  }
}

.login-brand {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 40px;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, #036b45 0%, #023a25 100%);
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .login-brand {
    display: flex;
  }
}

.login-brand::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  bottom: -80px;
  right: -80px;
}

.login-brand::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(199, 161, 66, 0.35);
  top: 32px;
  left: 32px;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.login-brand-logo {
  width: min(280px, 90%) !important;
  max-width: min(280px, 90%) !important;
  height: auto !important;
  filter: brightness(0) invert(1);
}

.login-brand-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
}

.login-brand-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.82);
  max-width: 320px;
  margin: 0;
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(199, 161, 66, 0.5);
  background: rgba(199, 161, 66, 0.12);
  color: #f5e6b8;
  font-size: 0.8rem;
  font-weight: 600;
}

.login-brand-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7a142;
  box-shadow: 0 0 8px #c7a142;
}

.login-form-side {
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}

@media (min-width: 900px) {
  .login-form-side {
    padding: 48px 44px;
  }
}

.login-mobile-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

@media (min-width: 900px) {
  .login-mobile-logo {
    display: none;
  }
}

.login-mobile-logo img {
  width: 200px !important;
  max-width: 200px !important;
  height: auto !important;
}

.login-form-header {
  margin-bottom: 28px;
  text-align: center;
}

@media (min-width: 900px) {
  .login-form-header {
    text-align: right;
  }
}

.login-form-header h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  color: #1a1a1a;
}

.login-form-header p {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
}

.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input-wrap:focus-within {
  border-color: #048d5a;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(4, 141, 90, 0.12);
}

.login-input-wrap.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.login-input-wrap svg {
  flex-shrink: 0;
  color: #9ca3af;
}

.login-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: #111827;
  font-family: inherit;
  font-weight: 600;
}

.login-input-wrap input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.login-eye-btn {
  border: none;
  background: none;
  padding: 0;
  display: flex;
  cursor: pointer;
}

.login-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.85rem;
}

.login-field-error {
  margin: 6px 0 0;
  color: #ef4444;
  font-size: 0.78rem;
}

.login-submit {
  margin-top: 8px;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #048d5a 0%, #036b45 100%);
  box-shadow: 0 10px 25px -8px rgba(4, 141, 90, 0.55);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  font-family: inherit;
}

.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -8px rgba(4, 141, 90, 0.65);
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-submit-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-submit-spinner {
  width: 18px;
  height: 18px;
  animation: login-spin 0.8s linear infinite;
}

.login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
}

.login-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
  animation: login-fade-up 0.5s ease-out;
}

.login-success-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(4, 141, 90, 0.15), rgba(4, 141, 90, 0.05));
  border: 2px solid rgba(4, 141, 90, 0.25);
}

.login-success-icon svg {
  width: 44px;
  height: 44px;
  color: #048d5a;
}

.login-success h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #048d5a;
}

.login-success p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.login-progress {
  width: 200px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.login-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #048d5a, #c7a142);
  border-radius: 999px;
  animation: login-progress 2.5s ease-in-out forwards;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

@keyframes login-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes login-progress {
  from { width: 0%; }
  to { width: 100%; }
}
