/* ============================================================
   Générateur de Skill IA - styles dédiés
   Charte Team Helper : 0 émoji, accent #ef9400, pas de long tiret
   ============================================================ */

#skillgen-app .sg-hidden { display: none; }

#skillgen-app .sg-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #232d3a;
}

#skillgen-app textarea,
#skillgen-app input[type="text"],
#skillgen-app input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid #d4dae2;
  border-radius: 10px;
  background: #ffffff;
  color: #232d3a;
  transition: border-color .15s, box-shadow .15s;
}

#skillgen-app textarea { resize: vertical; }
#skillgen-app textarea:focus,
#skillgen-app input[type="text"]:focus,
#skillgen-app input[type="email"]:focus {
  outline: none;
  border-color: #ef9400;
  box-shadow: 0 0 0 3px rgba(239, 148, 0, .15);
}

.sg-examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.sg-chip {
  font-family: inherit;
  font-size: 13px;
  color: #5c6b7d;
  background: #ffffff;
  border: 1px solid #d4dae2;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.sg-chip:hover { border-color: #ef9400; color: #d98200; }

.sg-primary {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
}
.sg-primary:disabled { opacity: .55; cursor: not-allowed; }
.sg-small { padding: 9px 16px; font-size: 14px; }
.sg-ghost {
  background: transparent;
  border: 1px solid #d4dae2;
  color: #5c6b7d;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: color .15s;
}
.sg-ghost:hover { color: #232d3a; }

/* Conversation */
.sg-log {
  height: 340px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  background: #f7f9fb;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
}
.sg-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.sg-msg.ai { align-self: flex-start; background: #ffffff; border: 1px solid #d4dae2; border-bottom-left-radius: 4px; color: #232d3a; }
.sg-msg.user { align-self: flex-end; background: #232d3a; color: #ffffff; border-bottom-right-radius: 4px; }
.sg-msg.typing { align-self: flex-start; color: #8a97a6; font-style: italic; background: transparent; border: none; }

.sg-input { display: flex; gap: 8px; }
.sg-input input { flex: 1; }

/* Résultat */
.sg-result-title { font-size: 19px; margin: 0 0 14px; color: #232d3a; }

.sg-format { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sg-format-option { cursor: pointer; }
.sg-format-option input { display: none; }
.sg-format-box {
  display: block;
  padding: 12px 14px;
  border: 1px solid #d4dae2;
  border-radius: 10px;
  background: #ffffff;
  transition: border-color .15s, box-shadow .15s;
}
.sg-format-box strong { display: block; margin-bottom: 3px; color: #232d3a; }
.sg-format-box small { color: #5c6b7d; }
.sg-format-option input:checked + .sg-format-box {
  border-color: #ef9400;
  box-shadow: 0 0 0 3px rgba(239, 148, 0, .15);
}

.sg-author { margin-bottom: 18px; }
.sg-author label { display: block; font-size: 14px; margin-bottom: 6px; color: #232d3a; }
.sg-author .sg-opt { color: #8a97a6; }

/* Identité (prénom + email) */
.sg-subtitle { color: #5c6b7d; font-size: 14px; margin: 0 0 16px; }
.sg-identity { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.sg-field label { display: block; font-size: 14px; margin-bottom: 5px; color: #232d3a; font-weight: 500; }
.sg-field .sg-required { color: #c0392b; }
.sg-field .sg-opt { color: #8a97a6; font-weight: 400; }
.sg-invalid { border-color: #c0392b !important; box-shadow: 0 0 0 3px rgba(192, 57, 43, .12) !important; }

.sg-quota { font-size: 13.5px; color: #5c6b7d; margin: 0 0 14px; }
.sg-quota-ok { color: #1e8e3e; font-weight: 600; }
.sg-quota-warn { color: #d98200; }

/* Barre de progression */
.sg-progress { margin-bottom: 18px; }
.sg-progress-bar {
  width: 100%;
  height: 10px;
  background: #e3e8ee;
  border-radius: 999px;
  overflow: hidden;
}
.sg-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ef9400, #f0a832);
  border-radius: 999px;
  transition: width .3s ease;
}
.sg-progress-text { font-size: 13px; color: #5c6b7d; margin: 8px 0 0; }

.sg-result-actions { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

/* Modal abonnement */
.sg-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.sg-modal-backdrop { position: absolute; inset: 0; background: rgba(13, 17, 23, .55); }
.sg-modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  z-index: 1;
}
.sg-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #8a97a6;
  cursor: pointer;
}
.sg-modal-close:hover { color: #232d3a; }
.sg-modal-card h3 { margin: 0 0 10px; font-size: 19px; color: #232d3a; }
.sg-modal-card p { color: #5c6b7d; font-size: 14.5px; margin: 0 0 16px; }
.sg-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.sg-price-value { font-size: 32px; font-weight: 700; color: #232d3a; }
.sg-price-per { font-size: 15px; color: #5c6b7d; }
.sg-price-note { font-size: 13px; color: #8a97a6; margin-bottom: 18px !important; }
.sg-modal-note { margin-top: 12px !important; font-size: 13px; color: #d98200; }
.sg-modal-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sg-modal-fields .sg-field label { display: block; font-size: 14px; margin-bottom: 5px; color: #232d3a; font-weight: 500; }
.sg-modal-fields .sg-field .sg-required { color: #c0392b; }
.sg-modal-fields input[type="text"],
.sg-modal-fields input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14.5px;
  font-family: inherit;
  border: 1px solid #d4dae2;
  border-radius: 10px;
  background: #ffffff;
  color: #232d3a;
}
.sg-modal-fields input:focus { outline: none; border-color: #ef9400; box-shadow: 0 0 0 3px rgba(239, 148, 0, .15); }
.sg-modal-home {
  display: block;
  margin-top: 14px;
  font-size: 13.5px;
  color: #5c6b7d;
  text-decoration: none;
}
.sg-modal-home:hover { color: #232d3a; text-decoration: underline; }

.sg-preview { margin-top: 4px; }
.sg-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sg-name { font-weight: 600; color: #d98200; word-break: break-all; }
.sg-content {
  background: #0d1117;
  color: #e6edf3;
  border-radius: 10px;
  padding: 14px;
  max-height: 380px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

@media (max-width: 560px) {
  .sg-msg { max-width: 92%; }
  .sg-result-actions { flex-direction: column; }
  .sg-input { flex-direction: column; }
}
