/* frontend/css/main.css */

:root {
  /* Cores Firm Capital */
  --gray-dark: #2d2d2d;
  --gray-medium: #4a4a4a;
  --beige: #f4f1ea;
  --accent-gold: #c5a47e;
  --text-dark: #333;
  --text-light: #fff;
  --font-primary: "Roboto", sans-serif;

  /* Tons complementares */
  --gray-light: #6b6b6b;
  --gray-lighter: #9a9a9a;
  --beige-dark: #e8e4db;
  --beige-darker: #ddd8cc;
  --gold-light: #d4b896;
  --gold-dark: #b69568;

  /* Cores de estado */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(45, 45, 45, 0.05);
  --shadow: 0 1px 3px 0 rgba(45, 45, 45, 0.1),
    0 1px 2px -1px rgba(45, 45, 45, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(45, 45, 45, 0.1),
    0 2px 4px -2px rgba(45, 45, 45, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(45, 45, 45, 0.1),
    0 4px 6px -4px rgba(45, 45, 45, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(45, 45, 45, 0.1),
    0 8px 10px -6px rgba(45, 45, 45, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  background: var(--beige);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Loading Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(45, 45, 45, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-content {
  text-align: center;
  color: var(--text-light);
}

.spinner {
  border: 4px solid var(--beige-darker);
  border-top: 4px solid var(--accent-gold);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: var(--text-light);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 10000;
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--error);
}

.toast-warning {
  background: var(--warning);
}

.toast-info {
  background: var(--info);
}

/* Buttons */
.btn {
  background: linear-gradient(
    135deg,
    var(--accent-gold) 0%,
    var(--gold-dark) 100%
  );
  color: var(--text-light);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  font-family: var(--font-primary);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(
    135deg,
    var(--gold-light) 0%,
    var(--accent-gold) 100%
  );
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: linear-gradient(
    135deg,
    var(--gray-medium) 0%,
    var(--gray-dark) 100%
  );
}

.btn-secondary:hover {
  background: linear-gradient(
    135deg,
    var(--gray-light) 0%,
    var(--gray-medium) 100%
  );
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-outline:hover {
  background: var(--accent-gold);
  color: var(--text-light);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, var(--error) 100%);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--gray-dark);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--beige-darker);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-primary);
  transition: all 0.2s ease;
  background: var(--beige);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(197, 164, 126, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Cards */
.card {
  background: var(--beige);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--beige-darker);
  margin-bottom: 1.5rem;
}

.card-header {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--gray-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--beige-darker);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}
.p-4 {
  padding: 2rem;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.5rem;
}
.gap-2 {
  gap: 1rem;
}
.gap-3 {
  gap: 1.5rem;
}
.gap-4 {
  gap: 2rem;
}

/* ========== MODAL DE CONFIRMAÇÃO ========== */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.confirm-content {
  background: var(--beige);
  border-radius: 12px;
  max-width: 450px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  animation: scaleIn 0.2s forwards;
}

@keyframes scaleIn {
  to {
    transform: scale(1);
  }
}

.confirm-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--beige-darker);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.confirm-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.confirm-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.confirm-icon.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.confirm-icon.info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.confirm-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.confirm-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--gray-dark);
  font-weight: 600;
}

.confirm-body {
  padding: 1.5rem;
  color: var(--gray-medium);
  font-size: 1rem;
  line-height: 1.5;
}

.confirm-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--beige-darker);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.confirm-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-width: 100px;
}

.confirm-btn-cancel {
  background: var(--beige-dark);
  color: var(--gray-medium);
  border: 1px solid var(--beige-darker);
}

.confirm-btn-cancel:hover {
  background: var(--beige-darker);
  color: var(--gray-dark);
}

.confirm-btn-confirm {
  background: var(--accent-gold);
  color: var(--text-light);
}

.confirm-btn-confirm:hover {
  background: #b89668;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.confirm-btn-confirm.danger {
  background: var(--error);
}

.confirm-btn-confirm.danger:hover {
  background: #dc2626;
}

/* Prevenir flash de logo padrão */
.sidebar-logo,
[data-empresa-logo] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-logo.loaded,
[data-empresa-logo].loaded {
  opacity: 1;
}
