/* Reset e configurações globais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Container principal */
.container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Formas de fundo animadas */
.background {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: float 6s ease-in-out infinite;
}

.shape1 {
  width: 200px;
  height: 200px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape2 {
  width: 150px;
  height: 150px;
  top: 50%;
  right: -75px;
  animation-delay: 2s;
}

.shape3 {
  width: 300px;
  height: 300px;
  bottom: -150px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
  }
  50% {
    transform: translateY(0px) rotate(180deg);
  }
  75% {
    transform: translateY(20px) rotate(270deg);
  }
}

/* Caixa do formulário */
.form-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
  animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 35px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.logo i {
  font-size: 2.5rem;
  color: #667eea;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.logo h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.header p {
  color: #666;
  font-size: 1rem;
  font-weight: 400;
}

/* Formulário */
.login-form {
  width: 100%;
}

.input-group {
  margin-bottom: 25px;
  position: relative;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: auto;
}

.input-wrapper input {
  width: 100%;
  padding: 15px 50px 15px 50px;
  border: 2px solid #e1e8ed;
  border-radius: 12px;
  font-size: 1rem;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.input-wrapper input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: rgba(255, 255, 255, 1);
}

.input-wrapper input::placeholder {
  color: #aaa;
}

.input-wrapper i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 1.1rem;
  transition: color 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.input-wrapper input:focus + i {
  color: #667eea;
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 1.1rem;
  transition: color 0.3s ease;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.toggle-password:hover {
  color: #667eea;
}

/* Opções do formulário */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  font-size: 0.9rem;
}

.remember-me {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #666;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.remember-me input[type="checkbox"]:checked + .checkmark {
  background: #667eea;
  border-color: #667eea;
}

.remember-me input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.forgot-password {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Botão de login */
.login-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-btn::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-btn:hover::before {
  left: 100%;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn i {
  transition: transform 0.3s ease;
}

.login-btn:hover i {
  transform: translateX(5px);
}

/* Loading state */
.login-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.login-btn.loading .btn-text {
  opacity: 0;
}

.login-btn.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #e1e8ed;
}

.footer p {
  color: #666;
  font-size: 0.9rem;
}

.footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Estados de erro */
.input-wrapper.error input {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.05);
}

.input-wrapper.error i {
  color: #e74c3c;
}

.error-message {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 8px;
  margin-left: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: block;
  line-height: 1.4;
}

.error-message.show {
  opacity: 1;
}

/* Responsividade */
@media (max-width: 480px) {
  .form-box {
    margin: 20px;
    padding: 30px 25px;
    border-radius: 15px;
  }

  .logo h1 {
    font-size: 1.8rem;
  }

  .logo i {
    font-size: 2rem;
  }

  .form-options {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

@media (max-height: 600px) {
  .container {
    padding: 20px 0;
  }

  .form-box {
    padding: 30px;
  }
}

/* ===== MODAL STYLES ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 0;
  width: 90%;
  max-width: 500px;
  max-height: fit-content;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideInModal 0.4s ease-out;
  position: relative;
}

@keyframes slideInModal {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 30px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-header h3 i {
  margin-right: 10px;
  color: #ffd700;
}

.close {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.admin-contact-form {
  padding: 25px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s ease;
  background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.btn-cancel,
.btn-send {
  padding: 12px 25px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Poppins", sans-serif;
}

.btn-cancel {
  background: #f5f5f5;
  color: #666;
  border: 2px solid #ddd;
}

.btn-cancel:hover {
  background: #e8e8e8;
  border-color: #bbb;
}

.btn-send {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-send:active {
  transform: translateY(0);
}

.btn-send i {
  font-size: 0.9rem;
}

/* Loading state */
.btn-send.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-send.loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success message */
.success-message {
  background: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
  display: flex;
  align-items: center;
  gap: 10px;
}

.success-message i {
  color: #28a745;
  font-size: 1.2rem;
}

/* Error message */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-message i {
  color: #dc3545;
  font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10px;
  }

  .modal-header {
    padding: 12px 18px;
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .admin-contact-form {
    padding: 18px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .form-actions {
    flex-direction: column;
    margin-top: 20px;
    padding-top: 12px;
  }

  .btn-cancel,
  .btn-send {
    width: 100%;
    justify-content: center;
  }
}

/* ===== ESTILOS FIREBASE AUTHENTICATION ===== */

/* Área de Mensagens */
.message-area {
  margin-bottom: 20px;
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.message-area.success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 1px solid #b8dabc;
  color: #155724;
}

.message-area.error {
  background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
  border: 1px solid #f1c2c7;
  color: #721c24;
}

.message-area.info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  border: 1px solid #b3d7e0;
  color: #0c5460;
}

/* Botões dentro das mensagens */
.message-area button {
  font-size: 13px;
  transition: all 0.2s ease;
}

.message-area button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Estados do Botão */
.login-btn {
  position: relative;
  overflow: hidden;
}

.login-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.login-btn .spinner {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

.login-btn.loading .btn-text {
  opacity: 0.7;
}

.login-btn.loading .fa-arrow-right {
  display: none;
}

/* Estados de Input */
.input-wrapper.error input {
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.input-wrapper.success input {
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

/* Animação de fade in para mensagens */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-area {
  animation: fadeIn 0.3s ease;
}

/* Loading spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

/* Redirecionamento */
.redirecting {
  text-align: center;
  padding: 20px;
  color: #667eea;
  font-weight: 500;
}

.redirecting i {
  margin-right: 10px;
}
