:root {
  --primary: var(--success);
  --primary-hover: var(--primary-bg);
  --text-dark: var(--text-dark);
  --text-gray: var(--text-gray);
  --border-color: var(--border-color);
  --bg-color: var(--bg-light);
  --card-bg: var(--bg-card);
  --shadow: var(--shadow-light-card, 0 15px 45px rgba(0, 0, 0, 0.25));
  --pure-white: var(--pure-white);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease;
}

.login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: var(--bg-color);
}

.login-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 420px;
  padding: 45px 35px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  animation: fadeIn 0.5s ease-out;
}

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

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.logo-img {
  max-width: 250px;
  max-height: 40px;
  height: auto;
  object-fit: contain;
}

.login-header .logo-mark {
  max-width: 58px;
}

.login-header .logo-wordmark {
  max-width: 250px;
}

.logo-icon {
  font-size: 36px;
  color: var(--primary);
}

.logo-text {
  text-align: left;
  line-height: 1.1;
}

.logo-title {
  display: block;
  font-size: 0.85rem;
  color: var(--text-gray);
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-sub {
  display: block;
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 900;
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-gray);
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-left: 2px;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.03); /* Fundo sutilmente escuro para destacar no light mode */
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--input-text);
  font-family: inherit;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-transp);
}

.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-gray);
  cursor: pointer;
  padding: 5px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-top: -5px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember-me input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.forgot-password {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.forgot-password:hover {
  text-decoration: underline;
}

.btn-entrar {
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 4px 12px var(--primary-transp);
}

.btn-entrar:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px var(--primary-transp);
}

.btn-entrar:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-footer-links {
  margin-top: 30px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.login-footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.login-footer-links a:hover {
  text-decoration: underline;
}

/* Footer Simplificado */
.login-footer {
  padding: 30px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-gray);
  background: transparent;
}

/* Modal */
.modal-custom {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-content-custom {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 20px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 1px solid var(--border-color);
}

.modal-icon {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .login-card {
    padding: 30px 25px;
  }
}

/* ---- CUSTOM ALERT MODAL ---- */
.custom-alert-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.custom-alert-overlay.active { display: flex; }
.custom-alert-card {
  background: var(--bg-card);
  border: 1px solid rgba(220, 167, 78, 0.2);
  width: 100%; max-width: 400px;
  border-radius: 20px; padding: 40px 30px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  animation: alertPop 0.3s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}
@keyframes alertPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.custom-alert-icon {
  width: 70px; height: 70px;
  background: rgba(220, 167, 78, 0.1);
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  margin: 0 auto 20px; font-size: 2rem; color: var(--gold);
}
.custom-alert-card h3 { color: var(--text-dark); font-size: 1.4rem; margin-bottom: 12px; }
.custom-alert-card p { color: var(--text-gray); font-size: 1rem; line-height: 1.5; margin-bottom: 30px; }
.custom-alert-footer { display: flex; gap: 15px; }
.btn-alert-cancel, .btn-alert-confirm {
  flex: 1; padding: 12px; border-radius: 10px; font-family: inherit; font-weight: 700; cursor: pointer; transition: all 0.3s; border: none;
}
.btn-alert-cancel { background: var(--bg-light); color: var(--text-dark); border: 1px solid var(--border-color); }
.btn-alert-cancel:hover { background: var(--border-color); }
.btn-alert-confirm { background: linear-gradient(135deg, var(--primary-dark), var(--primary-bg)); color: var(--pure-white); box-shadow: 0 4px 15px rgba(25, 64, 37, 0.3); }
.btn-alert-confirm:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(25, 64, 37, 0.4); }
.custom-alert-loading { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.spinner-custom {
  width: 40px; height: 40px; border: 4px solid rgba(220, 167, 78, 0.1);
  border-left-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.custom-alert-loading p { margin-bottom: 0; color: var(--gold); font-weight: 600; }
