/**
 * Mahindra CMS — Admin authentication pages
 */

.admin-auth-page {
  min-height: 100vh;
  margin: 0;
  font-family: var(--admin-font);
  color: var(--admin-text);
  background: var(--admin-bg);
}

.admin-auth-shell {
  display: flex;
  min-height: 100vh;
}

/* Brand panel */
.admin-auth-brand {
  position: relative;
  display: none;
  flex: 1 1 45%;
  max-width: 520px;
  padding: var(--space-6) var(--space-5);
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.15) 0%, transparent 45%),
    linear-gradient(145deg, #b80324 0%, var(--admin-brand) 42%, #a00220 100%);
  color: var(--admin-text-inverse);
}

.admin-auth-brand__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.admin-auth-brand__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  max-width: 360px;
}

.admin-auth-brand__logo img {
  max-height: 52px;
  width: auto;
  filter: brightness(0) invert(1);
}

.admin-auth-brand__title {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.admin-auth-brand__subtitle {
  margin: 0;
  font-size: var(--admin-text-lg);
  line-height: 1.6;
  opacity: 0.9;
}

.admin-auth-brand__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-auth-brand__features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--admin-text-sm);
  opacity: 0.92;
}

.admin-auth-brand__features i {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--admin-radius-full);
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
}

.admin-auth-brand__footer {
  font-size: var(--admin-text-xs);
  opacity: 0.7;
}

/* Form panel */
.admin-auth-main {
  flex: 1 1 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.admin-auth-card {
  width: 100%;
  max-width: 420px;
  animation: admin-auth-enter 0.45s ease both;
}

@keyframes admin-auth-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-auth-card__mobile-logo {
  display: block;
  text-align: center;
  margin-bottom: var(--space-3);
}

.admin-auth-card__mobile-logo img {
  max-height: 44px;
  width: auto;
}

.admin-auth-card__header {
  margin-bottom: var(--space-4);
}

.admin-auth-card__title {
  margin: 0 0 0.375rem;
  font-size: var(--admin-text-xl);
  font-weight: 700;
  color: var(--admin-text);
  letter-spacing: -0.02em;
}

.admin-auth-card__desc {
  margin: 0;
  font-size: var(--admin-text-sm);
  color: var(--admin-text-muted);
  line-height: 1.5;
}

/* Form fields */
.admin-auth-field {
  margin-bottom: var(--space-3);
}

.admin-auth-field__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: var(--admin-text-sm);
  font-weight: 600;
  color: var(--admin-text-secondary);
}

.admin-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.admin-auth-input-wrap__icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
  transition: color var(--admin-transition);
}

.admin-auth-input-wrap:focus-within .admin-auth-input-wrap__icon {
  color: var(--admin-brand);
}

.admin-auth-input {
  width: 100%;
  padding: 0.75rem 0.875rem 0.75rem 2.5rem;
  font-size: var(--admin-text-base);
  color: var(--admin-text);
  background: var(--admin-surface);
  border: 1.5px solid var(--admin-border);
  border-radius: var(--admin-radius);
  transition:
    border-color var(--admin-transition),
    box-shadow var(--admin-transition);
}

.admin-auth-input::placeholder {
  color: var(--admin-text-muted);
}

.admin-auth-input:hover:not(:disabled) {
  border-color: var(--admin-border-strong);
}

.admin-auth-input:focus {
  outline: none;
  border-color: var(--admin-brand);
  box-shadow: 0 0 0 3px var(--admin-brand-light);
}

.admin-auth-input.is-invalid {
  border-color: var(--admin-danger);
  box-shadow: 0 0 0 3px var(--admin-danger-bg);
}

.admin-auth-input:disabled {
  background: var(--admin-bg);
  color: var(--admin-text-muted);
  cursor: not-allowed;
}

.admin-auth-input-wrap--password .admin-auth-input {
  padding-right: 2.75rem;
}

.admin-auth-input-wrap__toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: var(--admin-radius-sm);
  background: transparent;
  color: var(--admin-text-muted);
  cursor: pointer;
  transition:
    color var(--admin-transition),
    background var(--admin-transition);
}

.admin-auth-input-wrap__toggle:hover {
  color: var(--admin-text);
  background: var(--admin-bg);
}

.admin-auth-field__error {
  margin-top: 0.375rem;
  font-size: var(--admin-text-xs);
  color: var(--admin-danger);
}

/* Submit button */
.admin-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: var(--space-1);
  padding: 0.8125rem 1.25rem;
  font-size: var(--admin-text-base);
  font-weight: 600;
  color: var(--admin-text-inverse);
  background: var(--admin-brand);
  border: 1.5px solid var(--admin-brand);
  border-radius: var(--admin-radius);
  cursor: pointer;
  transition:
    background var(--admin-transition),
    border-color var(--admin-transition),
    transform var(--admin-transition),
    box-shadow var(--admin-transition);
}

.admin-auth-submit:hover:not(:disabled) {
  background: var(--admin-brand-hover);
  border-color: var(--admin-brand-hover);
  box-shadow: var(--admin-shadow-md);
}

.admin-auth-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.admin-auth-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.admin-auth-submit__spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: admin-auth-spin 0.65s linear infinite;
}

.admin-auth-submit.is-loading .admin-auth-submit__spinner {
  display: inline-block;
}

.admin-auth-submit.is-loading .admin-auth-submit__text {
  opacity: 0.9;
}

@keyframes admin-auth-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer link */
.admin-auth-footer {
  margin-top: var(--space-3);
  text-align: center;
}

.admin-auth-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--admin-text-sm);
  font-weight: 600;
  color: var(--admin-accent);
  text-decoration: none;
  transition: color var(--admin-transition);
}

.admin-auth-footer__link:hover {
  color: var(--admin-brand);
}

.admin-auth-footer__link i {
  font-size: 0.75rem;
}

/* Desktop layout */
@media (min-width: 992px) {
  .admin-auth-brand {
    display: flex;
  }

  .admin-auth-card__mobile-logo {
    display: none;
  }

  .admin-auth-main {
    padding: var(--space-5);
  }
}

@media (max-width: 991.98px) {
  .admin-auth-main {
    align-items: flex-start;
    padding-top: var(--space-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-auth-card {
    animation: none;
  }

  .admin-auth-submit__spinner {
    animation-duration: 1.5s;
  }
}
