@import url("../painel-licitacoes/style.css");

* {
  scrollbar-width: thin;
  scrollbar-color: #6f86a8 #dce7f4;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #dce7f4;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid #dce7f4;
  border-radius: 999px;
  background: #6f86a8;
}

*::-webkit-scrollbar-thumb:hover {
  background: #113a77;
}

.imovel-admin-card__imagem {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #edf2f8;
}

.imovel-admin-card__imagem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imovel-admin-card__imagem-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: #64748b;
  font-weight: 700;
}

.imovel-admin-card__summary {
  display: grid;
  gap: 10px;
}

.imovel-repeat-list {
  display: grid;
  gap: 12px;
}

.imovel-repeat-list.is-scrollable {
  max-height: 500px;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.imovel-repeat-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid #dce7f4;
  border-radius: 12px;
  background: #f8fbff;
}

.imovel-repeat-row .field {
  margin: 0;
}

.imovel-repeat-row .btn--danger {
  margin-top: 24px; /* Align with input, pushing down from the label */
}

.imovel-repeat-row[data-repeat-row="caract_extra"] {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) auto;
  grid-template-areas:
    "icon label remove"
    "icon value remove";
  align-items: end;
}

.imovel-repeat-row[data-repeat-row="caract_extra"] .field--icon-picker {
  grid-area: icon;
  align-self: start;
}

.imovel-repeat-row[data-repeat-row="caract_extra"] .field:nth-of-type(2) {
  grid-area: label;
}

.imovel-repeat-row[data-repeat-row="caract_extra"] .field:nth-of-type(3) {
  grid-area: value;
}

.imovel-repeat-row[data-repeat-row="caract_extra"] .btn--danger {
  grid-area: remove;
  align-self: end;
  margin-top: 0;
}

.imovel-tipo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

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

.field-password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 0;
  color: #66768d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.field-password-toggle:hover {
  color: #113a77;
}

.field-password-wrapper input {
  padding-right: 44px;
}

.imovel-repeat-row[hidden] {
  display: none;
}

.form-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.imovel-slug-field {
  position: relative;
}

.imovel-slug-field.is-locked input {
  color: #46566e;
  background: #edf3fa;
}

.imovel-slug-field__overlay {
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.22);
  pointer-events: auto;
  cursor: not-allowed;
}

.field--upload-path {
  position: relative;
}

.imovel-upload-area {
  border: 2px dashed #6f86a8;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(135deg, #f4f8fd 0%, #e9f1fb 100%);
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imovel-upload-area:hover:not(.is-disabled),
.imovel-upload-area.is-over {
  border-color: var(--admin-primary, #113a77);
  background: rgba(17, 58, 119, 0.04);
}

.imovel-upload-area.is-disabled {
  cursor: default;
  opacity: 0.8;
}

.imovel-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: #6a7b92;
}

.imovel-upload-placeholder[hidden],
.imovel-upload-preview[hidden],
.upload-status[hidden] {
  display: none !important;
}

.imovel-upload-placeholder i {
  font-size: 2.5rem;
}

.imovel-upload-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.imovel-upload-preview img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 8px;
}

.imovel-upload-remove,
.imovel-gallery-remove {
  position: absolute;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}

.imovel-upload-remove {
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(167, 39, 39, 0.9);
}

.imovel-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.imovel-gallery-item {
  background: var(--admin-field-bg, #f8fbff);
  border: 1px solid var(--admin-border, #d9e4f2);
  border-radius: 12px;
  padding: 8px;
  position: relative;
}

.imovel-gallery-item img,
.imovel-gallery-item video,
.imovel-gallery-item [data-gallery-preview] {
  width: 100%;
  height: 120px;
}

.imovel-gallery-item img,
.imovel-gallery-item video {
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.imovel-gallery-item video {
  display: block;
  background: #0f1828;
}

.imovel-gallery-remove {
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.5);
}

.imovel-section-gallery-stack {
  display: grid;
  gap: 18px;
}

.imovel-aviso-config {
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid #dce7f4;
  border-radius: 12px;
  background: #f8fbff;
}

.imovel-aviso-config h4,
.imovel-info-heading h4 {
  margin: 0 0 12px;
  color: #113a77;
  font-size: 1rem;
}

.imovel-aviso-config .imovel-card-retratil-header {
  min-height: 28px;
}

.imovel-aviso-config .imovel-card-retratil-header h4 {
  margin: 0;
}

.imovel-aviso-config .imovel-card-retratil-content {
  margin-top: 12px;
  padding-top: 14px;
}

.imovel-aviso-config textarea {
  min-height: 76px;
  height: 76px;
}

.imovel-info-heading {
  margin-top: 24px;
}

.imovel-info-heading h4 {
  margin-bottom: 4px;
}

.imovel-info-sections {
  display: grid;
  gap: 14px;
}

.imovel-info-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dce7f4;
  border-radius: 12px;
  background: #f8fbff;
}

.imovel-info-section__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.imovel-info-section__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.imovel-info-section__title-row label {
  margin: 0;
}

.imovel-section-gallery {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dce7f4;
  border-radius: 12px;
  background: #f8fbff;
}

.imovel-section-gallery__header {
  margin: 0;
  gap: 12px;
}

.imovel-section-gallery__header h4 {
  margin: 0;
  color: #113a77;
  font-size: 1rem;
}

.imovel-section-gallery__header p {
  margin: 4px 0 0;
  color: #66768d;
  font-size: 0.9rem;
}

.imovel-section-gallery__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.imovel-section-gallery__fields {
  margin-top: 4px;
}

.field--checkbox {
  justify-content: end;
}

.field--checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: auto;
  font-weight: 700;
}

.field--checkbox input {
  width: auto;
}

#imovelForm.is-edital-mode [data-edital-extra] {
  display: none !important;
}

.imovel-icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 38px);
  gap: 8px;
}

.imovel-icon-choice {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--admin-border, #c7d6ea);
  border-radius: 8px;
  background: var(--admin-field-bg, #f8fbff);
  color: #113a77;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.imovel-icon-choice i {
  font-size: 1.2rem;
}

.imovel-icon-choice:hover,
.imovel-icon-choice:focus-visible,
.imovel-icon-choice.is-selected {
  border-color: #2f6fbd;
  background: #e8f1ff;
  color: #0b4a8f;
  transform: translateY(-1px);
}

.imovel-icon-choice.is-selected {
  box-shadow: 0 0 0 2px rgba(47, 111, 189, 0.18);
}

.imovel-edital-action {
  cursor: pointer;
}

.imovel-edital-action input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.imovel-edital-action.is-selected,
.imovel-edital-action:has(input:checked) {
  border-color: #00a878;
  background: #00a878;
  color: #ffffff;
}

.imovel-section-gallery .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.imovel-file-upload-wrapper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--admin-border, #c7d6ea);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fbff;
}

.imovel-file-upload-wrapper .btn {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 16px;
  margin: 0;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--admin-border, #c7d6ea);
  background: transparent;
  color: #113a77;
  font-weight: 600;
}

.imovel-file-upload-wrapper .btn:hover {
  background: rgba(17, 58, 119, 0.05);
}

.imovel-file-upload-wrapper input[type="text"] {
  flex: 1;
  min-width: 0;
  background-color: transparent !important;
  color: #6a7b92 !important;
  pointer-events: none;
  box-shadow: none !important;
  border: none !important;
  margin: 0;
  padding-left: 12px;
}

.imovel-repeat-row {
  position: relative;
}

.imovel-repeat-row [data-upload-status] {
  margin-top: 10px;
}

.upload-progress-bar {
  width: 0%;
}

/* Retratil no Painel */
.imovel-card-retratil-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.imovel-card-retratil-header i {
  font-size: 1.25rem;
  transition: transform 0.3s;
}
.imovel-card-retratil.is-expanded .imovel-card-retratil-header i {
  transform: rotate(180deg);
}
.imovel-card-retratil-content {
  display: none;
  margin-top: 1.5rem;
  border-top: 1px solid #dce7f4;
  padding-top: 1.5rem;
}
.imovel-card-retratil.is-expanded .imovel-card-retratil-content {
  display: block;
}

.imovel-endereco-mapa {
  margin: 4px 0 22px;
  padding: 0;
  border: 1px solid #dce7f4;
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.72);
}

.imovel-endereco-mapa .imovel-card-retratil-header {
  padding: 16px;
}

.imovel-endereco-mapa .imovel-card-retratil-content {
  margin: 0;
  padding: 16px;
}

body.admin-tema-escuro .imovel-card-retratil-content {
  border-top-color: #2a3b56;
}

body.admin-tema-escuro * {
  scrollbar-color: #526a90 #0f1828;
}

body.admin-tema-escuro *::-webkit-scrollbar-track {
  background: #0f1828;
}

body.admin-tema-escuro *::-webkit-scrollbar-thumb {
  border-color: #0f1828;
  background: #526a90;
}

body.admin-tema-escuro .imovel-slug-field.is-locked input {
  color: #8396b4;
  background: #0f1828;
}

body.admin-tema-escuro .imovel-slug-field__overlay {
  background: rgba(2, 6, 23, 0.42);
}

body.admin-tema-escuro .imovel-admin-card__imagem,
body.admin-tema-escuro .imovel-repeat-row,
body.admin-tema-escuro .imovel-endereco-mapa,
body.admin-tema-escuro .imovel-section-gallery,
body.admin-tema-escuro .imovel-aviso-config,
body.admin-tema-escuro .imovel-info-section,
body.admin-tema-escuro .imovel-gallery-item {
  background: #0f1828;
  border-color: #2a3b56;
}

body.admin-tema-escuro .imovel-section-gallery__header h4 {
  color: #dbeafe;
}

body.admin-tema-escuro .imovel-aviso-config h4,
body.admin-tema-escuro .imovel-info-heading h4 {
  color: #dbeafe;
}

body.admin-tema-escuro .imovel-section-gallery__header p {
  color: #9eb1cc;
}

body.admin-tema-escuro .imovel-icon-choice {
  background: #0f1828;
  border-color: #2a3b56;
  color: #cfe1ff;
}

body.admin-tema-escuro .imovel-icon-choice:hover,
body.admin-tema-escuro .imovel-icon-choice:focus-visible,
body.admin-tema-escuro .imovel-icon-choice.is-selected {
  background: #1d3354;
  border-color: #526a90;
  color: #ffffff;
}

body.admin-tema-escuro .imovel-file-upload-wrapper {
  background: #0f1828;
  border-color: #2a3b56;
}

body.admin-tema-escuro .imovel-file-upload-wrapper .btn {
  border-color: #2a3b56;
  color: #9eb1cc;
}

body.admin-tema-escuro .imovel-file-upload-wrapper .btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.admin-tema-escuro .imovel-file-upload-wrapper input[type="text"] {
  color: #9eb1cc !important;
}

body.admin-tema-escuro .imovel-upload-area {
  border-color: #2a3b56;
  background: linear-gradient(135deg, #0f1828 0%, #14233a 100%);
}

body.admin-tema-escuro .imovel-upload-area:hover:not(.is-disabled),
body.admin-tema-escuro .imovel-upload-area.is-over {
  border-color: #526a90;
}

@media (max-width: 760px) {
  .imovel-repeat-row,
  .imovel-repeat-row[data-repeat-row="caract_extra"] {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .imovel-repeat-row[data-repeat-row="caract_extra"] .field--icon-picker,
  .imovel-repeat-row[data-repeat-row="caract_extra"] .field:nth-of-type(2),
  .imovel-repeat-row[data-repeat-row="caract_extra"] .field:nth-of-type(3),
  .imovel-repeat-row[data-repeat-row="caract_extra"] .btn--danger {
    grid-area: auto;
  }
}
