/* Base Reset, Typography, Controls & Utilities */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-base), color var(--transition-base);
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1;
  padding-top: var(--header-height);
}

body.is-admin-route #main-content {
  padding-top: 0;
}

h1,
h2,
h3,
h4,
.font-display {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
video {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand-accent-text);
  outline-offset: 2px;
}

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

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 28px);
}

.section {
  padding-block: clamp(44px, 6vw, 76px);
}

.section-sm {
  padding-block: clamp(28px, 4vw, 48px);
}

.section-alt {
  background-color: var(--bg-surface-alt);
  border-block: 1px solid var(--border-subtle);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent-text);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
  font-weight: 800;
  line-height: 1.2;
}

.section-subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  max-width: 64ch;
  font-size: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: 50px;
  padding: 12px 24px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-accent-text);
  border-color: var(--brand-border-soft);
}

.btn-outline:hover {
  background-color: var(--brand-tint);
  border-color: var(--brand-primary);
}

.btn-secondary {
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-surface);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
}

.btn-whatsapp {
  background-color: var(--whatsapp-bg);
  color: #FFFFFF;
  box-shadow: var(--shadow-xs);
}

.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background-color: var(--danger-bg);
  color: var(--danger-fg);
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background-color: var(--danger-solid);
  color: #FFFFFF;
  border-color: var(--danger-solid);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-purpose {
  background-color: rgba(15, 27, 45, 0.78);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
}

.badge-status-destaque {
  background-color: var(--badge-featured-bg);
  color: var(--badge-featured-fg);
  border-color: var(--badge-featured-border);
}

.badge-status-ativo {
  background-color: var(--badge-active-bg);
  color: var(--badge-active-fg);
  border-color: var(--badge-active-border);
}

.badge-status-alugado {
  background-color: var(--badge-rented-bg);
  color: var(--badge-rented-fg);
  border-color: var(--badge-rented-border);
}

.badge-status-vendido {
  background-color: var(--badge-sold-bg);
  color: var(--badge-sold-fg);
  border-color: var(--badge-sold-border);
}

.badge-ratio {
  background-color: rgba(15, 27, 45, 0.76);
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

/* Form Elements */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.94rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.input[readonly] {
  background-color: var(--bg-surface-alt);
  color: var(--text-secondary);
  cursor: default;
}

/* Cards & Surfaces */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

/* Loading & Empty States */
.loading-state,
.empty-state {
  padding: 48px 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: 18px;
}

.spinner {
  width: 32px;
  height: 32px;
  margin-inline: auto;
  margin-bottom: 12px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--brand-primary);
  animation: spin 0.75s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  animation: toastIn 200ms ease-out;
}

.toast-success {
  border-left: 4px solid #16A34A;
}

.toast-error {
  border-left: 4px solid #DC2626;
}

.toast-info {
  border-left: 4px solid var(--brand-primary);
}

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

/* Modal Confirm Dialog */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background-color: rgba(7, 13, 24, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-dialog {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.confirm-dialog h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.confirm-dialog p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
