/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   LABELS & LINKS
   ========================================== */

label[for="id_login"],
label[for="id_name"],
label[for="id_password"],
label[for="id_password1"],
label[for="id_password2"],
label[for="id_cpf"],
label[for="id_email"] {
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-sm);
  font-weight: 400;
  color: var(--actus-text-primary);
  line-height: 14px;
  margin-bottom: var(--actus-space-sm);
}

a {
  color: var(--actus-primary);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover {
  opacity: 0.85;
}

.asteriskField {
    display: none;
}

#ac-forgetText {
  font-size: 0.9rem;
}

#ac-loginText:hover, #ac-forgetText:hover {
  text-decoration: none;
  color: var(--actus-primary);
  opacity: 0.8;
}

#ac-signupLink {
  font-weight: 600;
}

#ac-signupLink:hover {
  color: var(--actus-primary);
}

/* ==========================================
   INPUTS & PLACEHOLDERS
   ========================================== */

#id_login,
#id_password,
#id_email,
#id_name,
#id_cpf,
#id_password1,
#id_password2 {
  height: 48px;
  background-color: var(--actus-white);
  border: 1px solid var(--actus-border);
  border-radius: var(--actus-radius-md);
  padding: 12px;
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-sm);
  color: var(--actus-text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#id_login:focus,
#id_password:focus,
#id_email:focus,
#id_name:focus,
#id_cpf:focus,
#id_password1:focus,
#id_password2:focus {
  border-color: var(--actus-primary);
  box-shadow: 0 0 0 3px var(--actus-primary-light);
  outline: none;
  transform: translateY(-1px);
}

#id_login::placeholder,
#id_password::placeholder,
#id_email::placeholder,
#id_name::placeholder,
#id_cpf::placeholder,
#id_password1::placeholder,
#id_password2::placeholder {
  color: var(--actus-text-secondary);
  font-weight: 400;
  font-size: var(--actus-font-size-sm);
}

#id_password1_helptext {
  display: none;
}
/* ==========================================
   BUTTONS
   ========================================== */

.btn-actus-primary {
  height: 48px;
  background-color: var(--actus-primary);
  color: var(--actus-white);
  border: none;
  border-radius: var(--actus-radius-md);
  padding: 12px 24px;
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-sm);
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover, .btn-actus-primary:hover {
  opacity: 0.9;
  color: var(--actus-white);
  background-color: var(--actus-primary);
  transform: translateY(-1px);
}

.btn-actus-primary:active {
  transform: scale(0.98);
}

.btn-actus-primary:focus {
  box-shadow: 0 0 0 3px var(--actus-primary-light);
  outline: none;
}

/* Ripple effect for buttons */
.ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple-animation 0.3s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ==========================================
   SOCIAL AUTH
   ========================================== */

.ac-socialAccountDivider {
  color: var(--actus-text-muted);
}

a#ac-facebookLoginSocial {
  background-color: #3b5998;
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: var(--actus-radius-md);
  font-weight: 600;
  width: 180px;
  transition: opacity 0.15s ease;
}

a#ac-facebookLoginSocial:hover {
  opacity: 0.9;
}

a#ac-googleLoginSocial {
  background-color: #dd4b39;
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: var(--actus-radius-md);
  font-weight: 600;
  width: 180px;
  transition: opacity 0.15s ease;
}

a#ac-googleLoginSocial:hover {
  opacity: 0.9;
}

h3#ac-facebookProviderTitle {
  color: #3b5998;
  font-weight: 700;
}

h3#ac-googleProviderTitle {
  color: #dd4b39;
  font-weight: 700;
}

/* ==========================================
   SEPARATOR
   ========================================== */

.separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
}

.separator::before,
.separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--actus-border);
  margin: 0 10px;
}

.separator span {
  font-size: var(--actus-font-size-sm);
  color: var(--actus-text-muted);
  font-family: var(--actus-font-family);
}

/* ==========================================
   LAYOUT & CONTAINERS
   ========================================== */

body {
  font-family: var(--actus-font-family);
  color: var(--actus-text-primary);
}

label.form-label {
  display: block !important;
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-sm);
  font-weight: 400;
  color: var(--actus-text-primary);
  margin-bottom: var(--actus-space-sm);
}

.sc-bgIceWhite {
  background-color: var(--actus-background);
}

section.ac-formsContent {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  color: var(--actus-text-secondary);
  /* padding: 80px 133px; */
  animation: fadeInLeft 0.2s ease-out;
}

/* Logo Container */
.ac-logoContainer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--actus-space-xl);
  animation: fadeInUp 0.15s ease-out;
}

.ac-logoBox {
  width: 48px;
  height: 48px;
  background-color: var(--actus-primary);
  border-radius: var(--actus-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--actus-shadow-lg);
  animation: scaleIn 0.2s ease-out;
  transition: transform 0.15s ease;
}

.ac-logoBox:hover {
  transform: scale(1.05);
}

.ac-mainTitle {
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-xl);
  font-weight: 700;
  color: var(--actus-text-primary);
  margin: 0;
}

.ac-mainTitle span {
  font-weight: 400;
  color: var(--actus-text-secondary);
}

/* Page Titles */
.ac-pageTitle {
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-2xl);
  font-weight: 400;
  color: var(--actus-text-primary);
  line-height: 36px;
  margin-bottom: var(--actus-space-sm);
  animation: fadeInUp 0.15s ease-out 0.03s both;
}

.ac-pageSubtitle {
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-base);
  font-weight: 400;
  color: var(--actus-text-secondary);
  line-height: 24px;
  margin-bottom: var(--actus-space-xl);
  animation: fadeInUp 0.15s ease-out 0.06s both;
}

.ac-otp-subtitle {
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-base);
  font-weight: 400;
  color: var(--actus-text-secondary);
  line-height: 24px;
  animation: fadeInUp 0.15s ease-out 0.06s both;
}

/* Input Groups */
span.input-group-text {
  background-color: transparent;
  border-color: var(--actus-border);
  color: var(--actus-text-secondary);
}

span.ac-eyeIcon {
  cursor: pointer;
  border-left-color: transparent;
  transition: color 0.15s ease;
}

span.ac-eyeIcon:hover {
  color: var(--actus-primary);
}

#div_id_remember {
  padding-left: 0;
  /* margin-top: var(--actus-space-lg); */
  margin-bottom: var(--actus-space-lg);
}

/* Form Groups */
.mb-3 {
  margin-bottom: var(--actus-space-lg) !important;
}

/* Hero Section */
#ac-bgHome {
  background: linear-gradient(135deg, #e9d5ff 0%, #bfdbfe 50%, #a7f3d0 100%);
  min-height: 100vh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: fadeInRight 0.2s ease-out;
}

.ac-heroContent {
  text-align: center;
  max-width: 512px;
  padding: 48px;
  animation: fadeInUp 0.2s ease-out 0.05s both;
}

.ac-heroIcon {
  width: 128px;
  height: 128px;
  background-color: var(--actus-primary-light);
  border-radius: var(--actus-radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--actus-space-2xl);
  animation: scaleIn 0.2s ease-out 0.08s both;
  transition: transform 0.15s ease;
}

.ac-heroIcon:hover {
  transform: scale(1.05) rotate(5deg);
}

.ac-heroTitle {
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-3xl);
  font-weight: 400;
  color: var(--actus-text-primary);
  line-height: 40px;
  margin-bottom: var(--actus-space-lg);
}

.ac-heroSubtitle {
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-lg);
  font-weight: 400;
  color: var(--actus-text-secondary);
  line-height: 28px;
}

/* ==========================================
   FORM VALIDATION & ALERTS
   ========================================== */

.alert {
  border-radius: var(--actus-radius-md);
  font-family: var(--actus-font-family);
  font-size: var(--actus-font-size-sm);
  animation: slideInDown 0.2s ease-out;
}

.alert-danger,
.alert-error {
  background-color: #fee;
  border-color: var(--actus-error);
  color: var(--actus-error);
}

.alert-success {
  background-color: #efe;
  border-color: var(--actus-success);
  color: var(--actus-success);
}

.alert-info {
  background-color: #eff6ff;
  border-color: var(--actus-primary);
  color: var(--actus-primary);
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: var(--actus-space-sm) 0 0 0;
  color: var(--actus-error);
  font-size: var(--actus-font-size-sm);
}

.errorlist li {
  padding: var(--actus-space-xs) 0;
}

.is-invalid,
.error input {
  border-color: var(--actus-error) !important;
}

.is-invalid:focus,
.error input:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* ==========================================
   OTP AUTHENTICATION FLOW
   ========================================== */

.ac-otp-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--actus-space-xl, 2rem);
}

.ac-otp-header {
  display: flex;
  flex-direction: column;
  gap: var(--actus-space-2, 0.5rem);
  /* margin-bottom: var(--actus-space-lg, 1.5rem); */
}

.ac-otp-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--actus-space-2, 0.5rem);
  background-color: var(--actus-primary-alpha-light, rgba(13, 148, 136, 0.08));
  color: var(--actus-primary-700, #0f766e);
  padding: var(--actus-space-1, 0.25rem) var(--actus-space-3, 0.75rem);
  border-radius: var(--actus-radius-full, 9999px);
  font-size: var(--actus-font-size-sm, 0.875rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ac-otp-card {
  background-color: var(--actus-bg-primary, #ffffff);
  border: 1px solid var(--actus-border-light, var(--actus-border));
  border-radius: var(--actus-radius-xl, 1.5rem);
  box-shadow: var(--actus-shadow-md, 0 4px 20px rgba(15, 23, 42, 0.08));
  padding: var(--actus-space-6, 1.5rem);
}

.ac-otp-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--actus-space-5, 1.25rem);
}

.ac-otp-card-text {
  display: flex;
  flex-direction: column;
  gap: var(--actus-space-2, 0.5rem);
}

.ac-otp-title {
  font-size: var(--actus-font-size-xl, 1.25rem);
  font-weight: 600;
  color: var(--actus-text-primary);
  margin: 0;
}

.ac-otp-description {
  font-size: var(--actus-font-size-base, 1rem);
  color: var(--actus-text-secondary);
  margin: 0;
}

.ac-otp-alert {
  display: flex;
  align-items: center;
  gap: var(--actus-space-3, 0.75rem);
  padding: var(--actus-space-3, 0.75rem) var(--actus-space-4, 1rem);
  border-radius: var(--actus-radius-lg, 0.75rem);
  border: 1px solid var(--actus-border-danger, rgba(239, 68, 68, 0.4));
  background-color: var(--actus-error-50, #fef2f2);
  color: var(--actus-error, #dc2626);
  font-weight: 500;
}

.ac-otp-form {
  display: flex;
  flex-direction: column;
  gap: var(--actus-space-5, 1.25rem);
}

.ac-otp-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--actus-space-3, 0.75rem);
}

.ac-otp-label {
  font-size: var(--actus-font-size-sm, 0.875rem);
  font-weight: 600;
  color: var(--actus-text-primary);
}

.ac-otp-inputs {
  display: flex;
  gap: var(--actus-space-3, 0.75rem);
  justify-content: space-between;
}

.ac-otp-input {
  width: 3.5rem;
  height: 4rem;
  border-radius: var(--actus-radius-lg, 0.75rem);
  border: 1px solid var(--actus-border, #e2e8f0);
  background-color: var(--actus-bg-secondary, #f8fafc);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--actus-text-primary);
  transition: border-color var(--actus-transition-fast, 150ms ease), box-shadow var(--actus-transition-fast, 150ms ease), transform var(--actus-transition-fast, 150ms ease);
}

.ac-otp-input:focus {
  border-color: var(--actus-primary, #0d9488);
  box-shadow: 0 0 0 3px var(--actus-primary-light, rgba(13, 148, 136, 0.25));
  outline: none;
  transform: translateY(-1px);
}

.ac-otp-error {
  margin: 0;
  font-size: var(--actus-font-size-sm, 0.875rem);
  color: var(--actus-error, #dc2626);
}

.ac-otp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--actus-space-3, 0.75rem);
}

.ac-otp-submit {
  flex: 1;
  justify-content: center;
  gap: var(--actus-space-2, 0.5rem);
}

.ac-otp-secondary {
  flex: 1;
  color: var(--actus-text-secondary);
  border: 1px solid var(--actus-border, #e2e8f0);
  border-radius: var(--actus-radius-md, 0.5rem);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  background-color: transparent;
  transition: background-color var(--actus-transition-fast, 150ms ease);
}

.ac-otp-secondary:hover {
  background-color: rgba(148, 163, 184, 0.08);
}

.ac-otp-secondary-card {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(99, 102, 241, 0.08));
  border-radius: var(--actus-radius-xl, 1.5rem);
  padding: var(--actus-space-5, 1.25rem);
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  gap: var(--actus-space-2, 0.5rem);
}

.ac-otp-secondary-title {
  margin: 0;
  font-size: var(--actus-font-size-lg, 1.125rem);
  font-weight: 600;
  color: var(--actus-text-primary);
}

.ac-otp-secondary-text {
  margin: 0;
  color: var(--actus-text-secondary);
  font-size: var(--actus-font-size-base, 1rem);
}

.ac-otp-link {
  display: inline-flex;
  align-items: center;
  gap: var(--actus-space-2, 0.5rem);
  color: var(--actus-primary, #0d9488);
  font-weight: 600;
  text-decoration: none;
  padding: var(--actus-space-2, 0.5rem) 0;
  transition: color var(--actus-transition-fast, 150ms ease);
}

.ac-otp-link:hover {
  color: var(--actus-primary-700, #0f766e);
  text-decoration: none;
}

@media screen and (max-width: 575.98px) {
  .ac-otp-inputs {
    gap: var(--actus-space-2, 0.5rem);
  }

  .ac-otp-input {
    width: 2.75rem;
    height: 3.5rem;
  }

  .ac-otp-actions {
    flex-direction: column;
  }

  .ac-otp-submit,
  .ac-otp-secondary {
    width: 100%;
  }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ac-fadeIn {
  animation: fadeIn 0.15s ease-in;
}

/* Loading State */
.btn-actus-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-actus-primary.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-actus-primary.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid var(--actus-white);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.5s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--actus-primary);
  outline-offset: 2px;
}

/* Skip to content link */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  padding: 12px 24px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: var(--actus-primary);
  color: var(--actus-white);
  border-radius: var(--actus-radius-md);
  z-index: 9999;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --actus-border: #000;
  }

  .btn-actus-primary {
    border: 2px solid var(--actus-white);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media screen and (max-width: 991.98px) {
  section.ac-formsContent {
    /* padding: 40px 20px; */
    min-height: 100vh;
  }

  .ac-pageTitle {
    font-size: var(--actus-font-size-xl);
    line-height: 28px;
  }

  .ac-pageSubtitle {
    font-size: var(--actus-font-size-sm);
    line-height: 20px;
  }

  body {
    background-color: var(--actus-background);
  }

}

/* ==========================================
   ACCESSIBILITY - REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  section.ac-formsContent,
  .ac-logoContainer,
  .ac-logoBox,
  .ac-pageTitle,
  .ac-pageSubtitle,
  #ac-bgHome,
  .ac-heroContent,
  .ac-heroIcon {
    animation: none !important;
  }
}

@media screen and (max-width: 991.98px) {
  .ac-logoContainer {
    margin-bottom: var(--actus-space-lg);
  }
}

@media screen and (max-width: 575.98px) {
  .ac-logoBox {
    width: 40px;
    height: 40px;
  }

  .ac-logoBox img {
    width: 24px;
    height: 24px;
  }

  .ac-mainTitle {
    font-size: var(--actus-font-size-lg);
  }
}
