/* Mailior — volet. Sobre, accessible, contraste suffisant. */

:root {
  --brand: #0f6cbd;
  --brand-dark: #0a4f8c;
  --bg: #faf9f8;
  --card: #ffffff;
  --text: #201f1e;
  --muted: #605e5c;
  --border: #e1dfdd;
  --danger: #a4262c;
  --success: #107c10;
  --focus: #0f6cbd;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.pane {
  padding: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.pane__header {
  margin-bottom: 16px;
}

.pane__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-dark);
}

.pane__subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.card__title {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Meta email */
.meta {
  margin: 0;
}

.meta__row {
  display: flex;
  gap: 8px;
  padding: 2px 0;
}

.meta__label {
  flex: 0 0 80px;
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.meta__value {
  margin: 0;
  word-break: break-word;
}

/* Champs */
.field {
  margin-bottom: 12px;
}

.field__label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.field__control {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  width: 100%;
  color: #fff;
  background: var(--brand);
}

.btn--primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.btn--secondary {
  color: #fff;
  background: var(--success);
}

.btn--secondary:hover:not(:disabled) {
  background: #0b5a0b;
}

.btn--ghost {
  color: var(--brand-dark);
  background: #fff;
  border-color: var(--border);
}

.btn--ghost:hover:not(:disabled) {
  background: #f3f2f1;
}

/* Focus clavier visible (accessibilite) */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Zone reponse */
.reply {
  width: 100%;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Statut */
.status {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 13px;
}

.status--loading {
  color: var(--brand-dark);
}

.status--error {
  color: var(--danger);
  font-weight: 600;
}

.status--success {
  color: var(--success);
}

/* Spinner discret */
.status--loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Respect des preferences de mouvement reduit */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .status--loading::before {
    animation: none;
  }
}

/* Accessibilite : libelle visuellement masque mais lisible par lecteur d'ecran */
.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;
}

/* Badge d'etat du brouillon (volet v2) */
.badge {
  margin: 10px 0 0;
  padding: 4px 10px;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #0F6CBD;
  background: #eaf3fb;
  border-radius: 999px;
}
