/* ========================================================== */
/* ARQUIVO: ./index.css (Redesign Profissional de Login)      */
/* ========================================================== */

:root {
  --primary-color: #000000;
  --primary-dark: #1a1a1a;
  --primary-light: #333333;
  --secondary-color: #f8fafc;
  --text-color: #1A1F36;
  --text-light: #6B7280;
  --text-lighter: #9CA3AF;
  --border-color: #D1D5DB;
  --border-focus: #9CA3AF;
  --overlay-dark: #000000;
  --error: #EF4444;
  --success: #10B981;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #FFFFFF;
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.login-container {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  will-change: auto;
}

/* ---------------------------------------------------------- */
/* SEÇÃO DA ESQUERDA: PAINEL INFORMATIVO                      */
/* ---------------------------------------------------------- */

.login-image {
  flex: 0 0 65%;
  width: 65%;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100vh;
  height: 100vh;
}

.login-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.login-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
  z-index: 2;
}

.login-image .floating-circle {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  top: -250px;
  right: -250px;
  animation: float 20s ease-in-out infinite;
  z-index: 2;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-30px, 30px) rotate(180deg);
  }
}

.login-image-content {
  text-align: left;
  max-width: 520px;
  z-index: 10;
  position: relative;
  opacity: 1;
  visibility: visible;
  padding: 20px 0;
}

.login-image-content::after {
  display: none;
}

.login-image-content h2 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-image-content p {
  font-size: 1.35rem;
  line-height: 1.7;
  margin-bottom: 40px;
  opacity: 1;
  font-weight: 400;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.login-image-content::before {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin-bottom: 30px;
}

/* ---------------------------------------------------------- */
/* SEÇÃO DA DIREITA: FORMULÁRIO DE LOGIN                      */
/* ---------------------------------------------------------- */

.login-form {
  flex: 0 0 35%;
  width: 35%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 50px 80px 50px;
  background: #ffffff;
  position: relative;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  height: 100vh;
  will-change: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.login-form::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #000000 0%, transparent 100%);
  opacity: 0.5;
}

.login-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #000000 0%, #1a1a1a 100%);
  opacity: 1;
}

#login-section,
#password-reset-section,
#password-change-section,
#two-fa-section,
#support-section {
  width: 100%;
  max-width: 420px;
  opacity: 1;
  visibility: visible;
  position: relative;
}

#login-section::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #000000 50%, transparent 100%);
  border-radius: 2px;
  opacity: 0.5;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.login-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #000000 50%, transparent 100%);
  border-radius: 1px;
}

.login-header h1 {
  font-size: 2.25rem;
  color: var(--text-color);
  margin-bottom: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.login-header p {
  color: var(--text-light);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
}

/* --- Estilos do Formulário --- */

.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper {
  position: absolute;
  left: 18px;
  color: var(--text-lighter);
  z-index: 1;
  pointer-events: none;
  transition: color 0.2s;
}

.input-icon-wrapper svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.password-toggle {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-lighter);
  transition: color 0.2s;
  z-index: 2;
}

.password-toggle:hover {
  color: var(--primary-color);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle:focus {
  outline: none;
}

.form-input {
  width: 100%;
  padding: 14px 16px 14px 50px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  background-color: #fafbfc;
  color: var(--text-color);
  font-weight: 400;
  -webkit-appearance: none;
  appearance: none;
}

#password {
  padding-right: 50px;
}

.form-input:hover {
  background-color: #ffffff;
  border-color: #999999;
}

.form-input::placeholder {
  color: var(--text-lighter);
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
  transform: translateY(-1px);
}

.form-group:has(.form-input:focus) .input-icon-wrapper {
  color: var(--primary-color);
}

/* Fallback for browsers that don't support :has() */
.input-wrapper:focus-within .input-icon-wrapper {
  color: var(--primary-color);
}

.error-message {
  color: var(--error);
  font-size: 0.8125rem;
  display: none;
  margin-top: 6px;
  font-weight: 500;
  animation: shake 0.3s ease;
}

#reset-error-message {
  margin-top: 16px;
  margin-bottom: 0;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.875rem;
}

#reset-error-message[style*="display: block"] {
  display: block !important;
}

#error-message-2fa {
  display: none;
  margin-top: 20px;
  margin-bottom: 16px;
  padding: 14px 20px;
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 3px solid #EF4444;
  border-radius: 6px;
  color: #DC2626;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}

#error-message-2fa[style*="display: block"] {
  display: block !important;
}

.login-success-message {
  display: none;
  margin-top: 20px;
  margin-bottom: 16px;
  padding: 14px 20px;
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 3px solid #22C55E;
  border-radius: 6px;
  color: #16A34A;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}

.login-success-message[style*="display: block"] {
  display: block !important;
}

.login-error-message {
  display: none;
  margin-top: 20px;
  margin-bottom: 16px;
  padding: 14px 20px;
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 3px solid #EF4444;
  border-radius: 6px;
  color: #DC2626;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  animation: slideDown 0.3s ease;
}

.login-error-message::before {
  display: none;
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.form-group.error .form-input {
  border-color: var(--error);
}

.form-group.error .error-message {
  display: block;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  font-size: 0.875rem;
  padding-top: 4px;
}

.remember-me {
  display: flex;
  align-items: center;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: #CCCCCC;
  border-radius: 24px;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
  background-color: #000000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(20px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-switch:hover .toggle-slider {
  background-color: #999999;
}

.toggle-switch input[type="checkbox"]:checked:hover + .toggle-slider {
  background-color: #1a1a1a;
}

.toggle-label {
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.875rem;
  margin: 0;
}

.forgot-password a {
  color: #000000;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.forgot-password a:hover {
  color: #333333;
  text-decoration: underline;
}

.back-to-login {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
}

.back-to-login a {
  color: #000000;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.back-to-login a:hover {
  color: #333333;
  text-decoration: underline;
}

.login-button {
  width: 100%;
  padding: 14px 20px;
  background: #000000;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.login-button:hover::before {
  left: 100%;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  background: #1a1a1a;
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  text-align: center;
  margin-top: auto;
  padding-bottom: 20px;
  font-size: 0.8125rem;
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0.01em;
  width: 100%;
  max-width: 420px;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-footer p {
  margin: 0;
  text-align: center;
}

.login-footer strong {
  color: #000000;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

.support-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #000000;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0;
  z-index: 1000;
  box-shadow: none;
}

.support-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.support-button img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

/* Seção de Suporte */
.support-content {
  width: 100%;
}

.support-contacts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.support-contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #F9FAFB;
  border-radius: 8px;
  transition: all 0.2s;
  border: 1px solid #E5E7EB;
}

.support-contact-item:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

.support-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.support-icon.phone {
  background: #DBEAFE;
  color: #2563EB;
}

.support-icon.whatsapp {
  background: #D1FAE5;
  color: #059669;
}

.support-icon.email {
  background: #FCE7F3;
  color: #DB2777;
}

.support-icon svg {
  width: 24px;
  height: 24px;
}

.support-contact-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.support-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-lighter);
}

.support-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
}

.support-value:hover {
  color: var(--primary-color);
}

.support-schedule {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
  margin-bottom: 24px;
}

.support-schedule-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #F3F4F6;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.support-schedule-icon svg {
  width: 24px;
  height: 24px;
}

.support-schedule-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.support-schedule-text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-color);
  line-height: 1.6;
}

/* ---------------------------------------------------------- */
/* MODAIS E ELEMENTOS OCULTOS                                  */
/* ---------------------------------------------------------- */

/* Modal de Suporte */
.support-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.support-modal.show {
  opacity: 1;
}

.support-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.support-modal.show .support-modal-content {
  transform: scale(1);
}

.support-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background-color: #000000;
  border-radius: 12px 12px 0 0;
}

.support-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.support-modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.support-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.support-modal-body {
  padding: 30px;
}

.support-description {
  color: var(--text-light);
  font-size: 0.9375rem;
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.6;
}

.modern-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modern-modal.active,
.modern-modal.show {
  display: flex;
}

.modern-modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 20px;
  width: 100%;
}

.login-loader[style*="display: flex"],
.login-loader[style*="display:flex"] {
  display: flex !important;
}

.loader {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  color: var(--text-light);
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.02em;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------------------------------------------------------- */
/* RESPONSIVIDADE                                              */
/* ---------------------------------------------------------- */

@media (max-width: 900px) {
  .login-container {
    background: #f5f7fa;
  }
  
  .login-image {
    display: none;
  }
  
  .login-form {
    flex: 1 1 100%;
    width: 100%;
    position: relative;
    background-color: white;
    padding: 40px 24px;
  }
  
  #login-section,
  #password-reset-section {
    padding: 0;
    max-width: 100%;
  }
  
  .login-header h1 {
    font-size: 1.625rem;
  }
}

@media (max-width: 480px) {
  .login-form {
    padding: 32px 20px;
  }
  
  .login-header h1 {
    font-size: 1.625rem;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
