/* --- GERAL E PALETA DE CORES --- */
:root {
  /* Sua Paleta de Cores */
  --brand-blue: #0077B6;      /* Azul petróleo */
  --accent-green: #00C49A;    /* Verde menta */
  --soft-lavender: #CBA6F7;   /* Lavanda */
  --alert-coral: #FF7F7F;      /* Coral claro */
  --neutral-bg: #F2F2F2;        /* Cinza suave */

  /* Cores de apoio */
  --neutral-text: #333;
  --muted-text: #6c757d;
  --card-background: #ffffff;
  --border-color: var(--soft-lavender); /* Usando Lavanda para as bordas */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--neutral-bg); /* Usando Cinza Suave */
  color: var(--neutral-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- CABEÇALHO --- */
header {
  width: 100%;
  background: var(--card-background);
  border-bottom: 1px solid var(--border-color); /* Usando Lavanda */
}

.topbar {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 120px;
}

.brand-logo img {
  height: 100px;
  width: auto;
  display: block;
}

.topbar .welcome {
  margin: 0 auto;
  font-weight: 600;
  color: var(--muted-text);
}

header nav button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-color); /* Usando Lavanda */
  background-color: #f5f0fe; /* Tom bem claro de Lavanda */
  color: #583a8e; /* Tom escuro de Lavanda para texto */
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all 0.2s ease;
}

header nav button.danger {
  background-color: var(--alert-coral); /* Usando Coral Claro */
  color: #fff;
  border-color: var(--alert-coral);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

header nav button:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}
header nav button.danger:hover {
  filter: brightness(0.95);
  border-color: var(--alert-coral);
  color: #fff;
}


/* --- CONTEÚDO PRINCIPAL E CARDS --- */
main.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centraliza os cards */
  padding: 2rem 1rem;
  width: 100%;
}

.card {
  background: var(--card-background);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(203, 166, 247, 0.2); /* Sombra suave com tom de Lavanda */
  padding: 2rem;
  width: 100%;
  max-width: 450px;
  border: 1px solid var(--border-color); /* Usando Lavanda */
  margin-bottom: 2rem;
}

#view-signup .card { max-width: 700px; }
#client .card { max-width: 700px; }
#admin .card { max-width: 900px; }


.card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: left;
}

/* --- FORMULÁRIOS E BOTÕES --- */
.row { display: grid; gap: 1rem; }
.row2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

label {
  font-size: 13px;
  color: var(--muted-text);
  display: block;
  margin-bottom: 0.5rem;
}

label .required {
  color: var(--alert-coral); /* Usando Coral Claro */
  margin-left: 4px;
  font-weight: bold;
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #fff;
  font-size: 15px;
  font-family: inherit;
}

input:not([type="file"]) {
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}

input[type="file"] {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 8px;
}
input[type="file"]::file-selector-button {
  font-family: inherit;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  background-color: #f5f0fe;
  color: #583a8e;
  cursor: pointer;
  margin-right: 1rem;
}


input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(0, 119, 182, 0.2);
}
input:not([type="file"]):focus {
  border-bottom-color: var(--brand-blue);
  box-shadow: none;
}


.password-wrap { position: relative; }
.password-wrap .toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 12px; background: transparent; border: none; color: var(--muted-text); cursor: pointer; }

.actions { display: flex; gap: 1rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }
.modal-actions { justify-content: space-between; }


.btn { font-family: inherit; font-weight: 700; font-size: 15px; padding: 0.75rem 1.5rem; border-radius: 8px; border: none; cursor: pointer; background: var(--brand-blue); color: #fff; transition: filter 0.2s ease; }
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background-color: #f5f0fe; color: #583a8e; border: 1px solid var(--border-color); }
.btn.secondary:hover { filter: brightness(0.95); }
.btn.ghost { background: transparent; color: var(--neutral-text); border: 1px solid var(--border-color); }
.btn.danger { background-color: transparent; color: var(--alert-coral); border: 1px solid var(--alert-coral); }
.btn.danger:hover { background-color: var(--alert-coral); color: white; }


a.link, .hint a { color: var(--brand-blue); text-decoration: none; font-weight: 600; font-size: 14px; }
a.link:hover, .hint a:hover { text-decoration: underline; }

.hint { font-size: 14px; color: var(--muted-text); }


/* --- RODAPÉ --- */
footer { width: 100%; text-align: center; padding: 1.5rem; font-size: 13px; color: var(--muted-text); margin-top: auto; }


/* --- ELEMENTOS ESPECÍFICOS DA UI --- */
.kpi { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px; background-color: #e0f8f3; color: #005f4b; font-weight: 700; font-size: 12px; border: 1px solid var(--accent-green); }
#lib-grid {
  grid-template-columns: none; /* Remove a grade */
}

/* --- ESTILOS PARA BIBLIOTECA (TABELA) --- */
.library-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 14px;
}

.library-table th, .library-table td {
  border: 1px solid var(--border-color);
  padding: 12px 15px;
  text-align: left;
  vertical-align: middle;
}

.library-table th {
  background-color: #f5f0fe;
  font-weight: 600;
}

.library-table tbody tr:nth-of-type(even) {
  background-color: #f8fafc;
}

.library-table td:first-child {
  width: 74px; /* Largura para a miniatura 50px + padding */
}

.library-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.btn-delete-item {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--alert-coral);
  background-color: transparent;
  color: var(--alert-coral);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-item:hover {
  background-color: var(--alert-coral);
  color: #fff;
}


/* --- ESTILOS PARA O CARD "MINHA MARCA" --- */
.brand-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.brand-content { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; align-items: flex-start; }
.brand-logo-preview img { width: 150px; height: 150px; object-fit: contain; border: 1px solid var(--border-color); border-radius: 8px; padding: 0.5rem; }
.brand-details { display: flex; flex-direction: column; gap: 1.5rem; }
.color-swatches { display: flex; gap: 1rem; align-items: center; }
.color-swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.placeholder { font-style: italic; color: var(--muted-text); font-size: 14px; }

/* --- ESTILOS PARA SUGESTÕES DE CIDADE --- */
#city-suggestions { position: absolute; width: 100%; background-color: white; border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 8px 8px; z-index: 10; max-height: 150px; overflow-y: auto; }
#city-suggestions div { padding: 8px 12px; cursor: pointer; }
#city-suggestions div:hover { background-color: #f5f0fe; }

/* --- ESTILOS PARA PAINEL DE ADMIN --- */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.admin-table th, .admin-table td { border: 1px solid var(--border-color); padding: 8px 12px; text-align: left; font-size: 14px; }
.admin-table th { background-color: #f5f0fe; }
.admin-table code { background-color: #eee; padding: 2px 4px; border-radius: 4px; }
.admin-table .actions-cell { display: flex; gap: 8px; }
.admin-table .actions-cell button { font-size: 12px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border-color); cursor: pointer; background-color: #fff; }
.admin-table .actions-cell button:hover { background-color: #f5f0fe; }

/* --- ESTILOS PARA O MODAL DE ADMIN --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 100; padding: 1rem; }
.modal-content { width: 90%; max-width: 700px; }
.modal-content h2 {
  margin-bottom: 1.5rem; /* Adiciona espaçamento abaixo do título do modal */
}
.form-hint {
  font-size: 12px;
  color: var(--muted-text);
  margin-top: 4px;
  display: block;
}

/* --- ESTILOS PARA O WIZARD DE CRIAÇÃO --- */
.wizard-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
#wizard-step-indicator { font-weight: 600; color: var(--muted-text); }

#wizard-content { min-height: 200px; }
#wizard-content h2 { margin-bottom: 1.5rem; font-size: 20px; }
#wizard-content h3 { font-size: 16px; font-weight: 600; color: var(--muted-text); border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; margin-bottom: 1rem; }

.wizard-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.wizard-option-btn { padding: 1.5rem 1rem; border: 2px solid var(--border-color); border-radius: 12px; background-color: transparent; font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; text-align: center; }
.wizard-option-btn:hover { border-color: var(--brand-blue); background-color: #f0f8ff; color: var(--brand-blue); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 119, 182, 0.1); }
.wizard-option-btn.selected { border-color: var(--brand-blue); background-color: #f0f8ff; color: var(--brand-blue); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 119, 182, 0.15); }

#wizard-nav { margin-top: 2rem; display: flex; justify-content: space-between; }

.wizard-step-content { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1rem; }

/* --- UTILITÁRIOS E DIVERSOS --- */
.hidden { display: none !important; }

.btn:disabled { background-color: var(--muted-text); cursor: not-allowed; filter: none; }
.btn:disabled:hover { filter: none; }

.wizard-summary { list-style-type: none; padding: 0; margin: 1rem 0; background-color: #f5f0fe; border-radius: 8px; border: 1px solid var(--border-color); padding: 1rem; }
.wizard-summary li { font-size: 15px; color: var(--neutral-text); padding: 0.5rem 0; }
.wizard-summary li + li { border-top: 1px solid var(--border-color); }
.wizard-summary li strong { color: #583a8e; margin-right: 8px; }

.refinements-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.refinement-item { display: flex; align-items: center; background-color: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 0.75rem; transition: all 0.2s ease; }
.refinement-item:has(input:checked) { background-color: #f5f0fe; border-color: var(--brand-blue); }
.refinement-item input[type="checkbox"] { width: 1.25em; height: 1.25em; margin-right: 0.75rem; accent-color: var(--brand-blue); cursor: pointer; }
.refinement-item label { font-size: 14px; color: var(--neutral-text); margin-bottom: 0; cursor: pointer; }

/* --- ESTILOS PARA O MODAL DE RESULTADO --- */
.result-content { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin: 1.5rem 0; }
@media (min-width: 600px) { .result-content { grid-template-columns: 250px 1fr; } }
.result-image-wrapper img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); }
.result-caption-wrapper h3 { font-size: 16px; color: var(--muted-text); margin-bottom: 0.5rem; }
#result-caption-editor {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}
#btn-copy-caption { display: inline-flex; align-items: center; gap: 8px; margin-top: 1rem; }

/* --- ESTILOS PARA O PAINEL DE LÓGICA DO PROMPT --- */
.prompt-logic-card h1 { margin-bottom: 0.5rem; }
.prompt-logic-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.prompt-logic-section h3 { margin-bottom: 1rem; }
.prompt-logic-section p { line-height: 1.6; margin-bottom: 1rem; }
.prompt-logic-section ul { list-style-position: inside; padding-left: 0.5rem; }
.prompt-logic-section li { margin-bottom: 0.5rem; }
.prompt-template { background-color: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 1rem; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: #333; }
.prompt-template .placeholder-tag { color: var(--brand-blue); background-color: #e0f2ff; padding: 2px 6px; border-radius: 4px; font-weight: bold; }