/* ---------- Logo ---------- */
.brand-logo {
  max-width: 100%;
  object-fit: contain;
}

/* Uma variante por vez. Fora da barra lateral o fundo acompanha o tema. */
.brand-logo.is-dark {
  display: none;
}

:root:not([data-theme="light"]) .brand-logo.is-dark {
  display: block;
}

:root:not([data-theme="light"]) .brand-logo.is-light {
  display: none;
}

/* O selo quadrado, para onde o logo largo não cabe. */
.logo-mark-img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  object-fit: contain;
  flex-shrink: 0;
}

/* ---------- Field ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* `display: flex` vence o `[hidden]` do navegador — sem isto, esconder um campo
   pelo atributo não surte efeito em lugar nenhum do sistema. */
.field[hidden] {
  display: none;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.field-label .optional {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 1rem;
  display: flex;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.input {
  width: 100%;
  height: 3.25rem;
  background: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 0 1rem;
  color: hsl(var(--foreground));
  transition: var(--transition-smooth);
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

.input.has-icon {
  padding-left: 2.75rem;
}

.input.has-trailing {
  padding-right: 2.75rem;
}

.input.is-invalid {
  border-color: hsl(var(--destructive));
}

.input.is-invalid:focus {
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.2);
}

.field-trailing-btn {
  position: absolute;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  color: hsl(var(--muted-foreground));
  border-radius: 0.4rem;
}

.field-trailing-btn:hover {
  color: hsl(var(--foreground));
}

.field-error {
  font-size: 0.82rem;
  color: hsl(var(--destructive));
  min-height: 1.1em;
}

.field-hint {
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
}

.phone-field {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.6rem;
}

.select {
  width: 100%;
  height: 3.25rem;
  background: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  appearance: none;
  color: hsl(var(--foreground));
}

.select:focus {
  outline: none;
  border-color: hsl(var(--primary));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3.25rem;
  padding: 0 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.btn-primary {
  width: 100%;
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.btn-primary:disabled {
  opacity: 0.55;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-success {
  width: auto;
  background: hsl(var(--success));
  color: hsl(0 0% 100%);
}

.btn-success:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.btn-destructive {
  width: auto;
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.btn-ghost {
  color: hsl(var(--muted-foreground));
  background: transparent;
}

.btn-ghost:hover {
  color: hsl(var(--foreground));
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.btn-back:hover {
  color: hsl(var(--foreground));
}

.btn-link {
  background: none;
  color: hsl(var(--primary));
  font-weight: 500;
  font-size: 0.9rem;
}

/* ---------- Toggle ---------- */
.toggle {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: hsl(var(--foreground));
  transition: var(--transition-smooth);
}

.toggle.is-on {
  background: hsl(var(--primary) / 0.5);
  border-color: hsl(var(--primary));
}

.toggle.is-on::after {
  transform: translateX(1.25rem);
  background: hsl(var(--primary));
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

/* ---------- Alert / banner ---------- */
.banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
  border: 1px solid;
}

.banner-info {
  background: hsl(var(--primary) / 0.08);
  border-color: hsl(var(--primary) / 0.35);
  color: hsl(var(--foreground));
}

.banner-success {
  background: hsl(var(--success) / 0.1);
  border-color: hsl(var(--success) / 0.4);
}

.banner-error {
  background: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive) / 0.4);
  color: hsl(var(--foreground));
}

/* ---------- Cards / grids (nicho, serviços) ---------- */
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 700px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
}

.option-card {
  position: relative;
  text-align: left;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.option-card:hover {
  border-color: hsl(var(--primary) / 0.5);
}

.option-card.is-selected {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
}

.option-card .option-icon {
  font-size: 1.35rem;
}

.option-card .option-title {
  font-weight: 600;
}

.option-card .option-desc {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.option-check {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: var(--transition-smooth);
}

.option-card.is-selected .option-check {
  background: hsl(var(--success));
  color: hsl(var(--primary-foreground));
}

.service-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.service-price {
  font-weight: 700;
  color: hsl(var(--primary));
  margin-top: 0.35rem;
}

.selection-count {
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

/* ---------- Avatar upload ---------- */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.avatar-preview {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn-upload {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  background: hsl(var(--muted));
  font-weight: 500;
  align-self: flex-start;
}

.btn-upload:hover {
  border-color: hsl(var(--primary) / 0.5);
}

/* ---------- Spinner ---------- */
.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid hsl(var(--primary-foreground) / 0.35);
  border-top-color: hsl(var(--primary-foreground));
  animation: spin 0.7s linear infinite;
}

.spinner-muted {
  border-color: hsl(var(--muted-foreground) / 0.35);
  border-top-color: hsl(var(--muted-foreground));
}

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

/* ---------- Success state icon ---------- */
.state-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-icon.success {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
}
