/* Panneau SMS Meeting — identité de sms-meeting.com (vert pétrole + vert vif). */
:root {
  --petrole-900: #0c3a3d;
  --petrole: #14595d;
  --petrole-600: #1c797e;
  --petrole-50: #e8f2f2;
  --vert: #26c052;
  --vert-600: #1fa546;
  --vert-vif: #36d764;
  --vert-50: #e7f8ec;
  --vert-ink: #17863a;
  --ink: #102a2c;
  --ink-2: #33494b;
  --muted: #5f7577;
  --line: #dce6e6;
  --line-2: #e9efef;
  --bg: #f4f8f8;
  --card: #ffffff;
  --danger: #c62828;
  --danger-50: #fdecec;
  --danger-line: #f3b9b9;
  --warn: #9a5b00;
  --warn-50: #fff6e0;
  --warn-line: #f1cf7c;
  --focus: #0f6cbd;
  --radius: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  /* Dans Outlook le volet fait ~430 px ; ouvert dans un navigateur, le panneau
     garde la même largeur, centré, au lieu de s'étirer sur tout l'écran. */
  max-width: 480px;
  margin: 0 auto;
}

/* En-tête */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px 16px;
}
.header .logo {
  height: 40px;
  width: auto;
  display: block;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover {
  background: var(--line-2);
}

.content {
  flex: 1;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Cartes */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font: 700 16px/1.2 var(--font-display);
  color: var(--ink);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--petrole);
  color: #fff;
  font: 700 14px var(--font-display);
  flex: none;
}
.hint {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 13px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 6px 2px -2px;
}
.section-head h2 {
  margin: 0;
  font: 700 17px var(--font-display);
}
.section-head span {
  color: var(--muted);
  font-size: 13px;
}

/* Champs */
.field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.input,
.select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:hover,
.select:hover {
  border-color: #c3d2d2;
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--petrole-600);
  box-shadow: 0 0 0 3px rgba(28, 121, 126, 0.15);
}
.input[readonly] {
  background: var(--bg);
  color: var(--ink-2);
}
.input.is-invalid {
  border-color: var(--danger);
}
.select-wrap {
  position: relative;
}
.select {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
}
.select-wrap .i-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-2);
}
.select.sm {
  height: 34px;
  font-size: 14px;
}

.phone-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 8px;
}
.country-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  width: 100%;
}
.country-btn .i-chevron {
  margin-left: auto;
}
.flag {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex: none;
}
.attendees {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.attendee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
}
.attendee.is-active {
  border-color: var(--vert);
  background: var(--vert-50);
  color: var(--vert-ink);
}
.attendee[disabled] {
  opacity: 0.55;
  cursor: default;
}
.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.inline-field label {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.inline-field .input {
  height: 34px;
  font-size: 14px;
}

/* Menus déroulants maison */
.popover {
  position: absolute;
  z-index: 20;
  min-width: 200px;
  max-width: 300px;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 42, 44, 0.16);
}
.popover button.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}
.popover button.opt:hover,
.popover button.opt:focus {
  background: var(--petrole-50);
  outline: none;
}
.popover .opt small {
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}
.popover .opt-text {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  white-space: normal;
}
.popover-title {
  padding: 6px 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
}
.emoji-grid button {
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
}
.emoji-grid button:hover {
  background: var(--petrole-50);
}
.popover-note {
  padding: 6px 8px 2px;
  font-size: 12px;
  color: var(--muted);
}

/* Messages */
.msg-card {
  padding: 0;
  overflow: visible;
}
.msg-card.is-off .msg-body {
  display: none;
}
.msg-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}
.msg-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--petrole-50);
  color: var(--petrole);
}
.msg-icon.bell {
  color: var(--petrole-900);
}
.msg-icon.bell svg {
  fill: currentColor;
}
.msg-title {
  margin: 0;
  font: 700 16px var(--font-display);
}
.msg-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
}
.msg-sub .select-wrap {
  flex: 1;
  max-width: 230px;
}
.msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: start;
}
.msg-body {
  margin: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.msg-warning {
  margin: -6px 14px 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-50);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 13px;
}

/* Interrupteur */
.switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9d5d5;
  transition: background 0.15s;
  pointer-events: none;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.switch input:checked + span {
  background: var(--vert);
}
.switch input:checked + span::after {
  transform: translateX(22px);
}
.switch input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Éditeur */
.editor {
  min-height: 74px;
  padding: 12px 14px;
  font-size: 15.5px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
}
.editor.is-empty::before {
  content: attr(data-placeholder);
  color: #9aabab;
  pointer-events: none;
  position: absolute;
}
.chip {
  display: inline-block;
  padding: 0 8px;
  margin: 0 1px;
  border-radius: 8px;
  background: var(--vert-50);
  border: 1px solid #c9eed4;
  color: var(--vert-ink);
  line-height: 1.6;
  font-size: 14.5px;
  user-select: all;
}
.preview {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px dashed var(--line);
  background: #fbfdfd;
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: pre-wrap;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  position: relative;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  flex: none;
}
.tool:hover,
.tool.is-on {
  background: var(--line-2);
}
.tool .i-braces {
  width: 20px;
}
.counter {
  margin-left: auto;
  padding-left: 6px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
  min-width: 0;
}
.counter .unicode {
  display: inline-block;
  margin: 0 6px 0 0;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--warn-50);
  color: var(--warn);
  font-size: 11.5px;
}

.add-reminder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: 1.5px dashed #9fcdb0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--petrole-900);
  font: 700 15px var(--font-display);
}
.add-reminder:hover {
  background: var(--vert-50);
}
.add-reminder .i {
  color: var(--vert-600);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font: 600 16px var(--font);
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary {
  background: var(--vert);
  color: #fff;
}
.btn-primary:hover {
  background: var(--vert-600);
}
.btn-outline {
  background: #fff;
  border: 1px solid var(--petrole);
  color: var(--petrole-900);
}
.btn-outline:hover {
  background: var(--petrole-50);
}
.btn-ghost {
  background: transparent;
  color: var(--petrole-600);
  height: auto;
  padding: 4px;
  font-weight: 500;
  font-size: 14.5px;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}
.btn.sm {
  height: 32px;
  width: auto;
  font-size: 13.5px;
  padding: 0 12px;
}
.link {
  border: 0;
  background: none;
  color: #1066d1;
  font-size: 14.5px;
  padding: 2px;
}
.link:hover {
  text-decoration: underline;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.dark {
  border-color: var(--line);
  border-top-color: var(--petrole);
  width: 28px;
  height: 28px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Pied */
.footer {
  position: sticky;
  bottom: 0;
  padding: 12px 14px 14px;
  background: linear-gradient(to bottom, rgba(244, 248, 248, 0.85), var(--bg) 30%);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(4px);
}
.footer .btn {
  margin-bottom: 12px;
}
.footer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-row + .footer-row {
  margin-top: 6px;
}
.credits {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.credits.is-low {
  color: var(--danger);
}
.account {
  color: var(--muted);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--vert);
}

/* Écrans de connexion */
.auth-card {
  padding: 20px 18px 18px;
}
.auth-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}
.auth-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--petrole-50);
  color: var(--petrole);
}
.auth-icon.warn {
  background: var(--warn-50);
  color: #c47a00;
}
.auth-head h1 {
  margin: 6px 0 4px;
  font: 800 21px var(--font-display);
}
.auth-head p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.center-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.otp input {
  width: 100%;
  text-transform: uppercase;
  height: 52px;
  border: 1px solid #c9d5d5;
  border-radius: 8px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  background: #fff;
}
.otp input:focus {
  outline: none;
  border: 2px solid var(--focus);
}
.notice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}
.notice strong {
  display: block;
}
.notice.danger {
  background: var(--danger-50);
  border: 1px solid var(--danger-line);
  color: var(--danger);
}
.notice.warn {
  display: block;
  background: var(--warn-50);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 15px;
}
.notice.info {
  background: var(--petrole-50);
  border: 1px solid #c8dede;
  color: var(--petrole-900);
}
.error-detail {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.8;
  overflow-wrap: anywhere;
}
.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13.5px;
}

/* Bandeau de mise à jour */
.update-bar {
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--petrole);
  color: #fff;
  font-size: 13.5px;
}
.update-bar .row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.update-bar p {
  margin: 4px 0 8px 28px;
  opacity: 0.85;
  font-size: 12.5px;
}
.update-bar .actions {
  display: flex;
  gap: 8px;
  margin-left: 28px;
}
.update-bar .btn.sm {
  background: var(--vert-vif);
  color: var(--petrole-900);
}
.update-bar .btn.sm.secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* SMS déjà programmés */
.scheduled-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.scheduled-list li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line-2);
  font-size: 13.5px;
}
.scheduled-list li:first-child {
  border-top: 0;
}
.scheduled-list .meta {
  color: var(--muted);
  font-size: 12.5px;
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--petrole-50);
  color: var(--petrole);
}
.badge.sent {
  background: var(--vert-50);
  color: var(--vert-ink);
}

.done {
  text-align: center;
  padding: 26px 18px;
}
.done .big-check {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--vert-50);
  color: var(--vert);
  margin-bottom: 10px;
}
.done h1 {
  margin: 0 0 6px;
  font: 800 20px var(--font-display);
}
.done p {
  margin: 0 0 16px;
  color: var(--muted);
}

.loading {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 300px;
}
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  max-width: 456px;
  margin: 0 auto;
  bottom: 12px;
  z-index: 30;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Listes déroulantes maison */
.select.dd {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.select.dd .dd-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select.dd .i-chevron {
  flex: none;
  color: var(--ink-2);
}
.select.dd[aria-expanded="true"],
.select.dd:focus-visible {
  border-color: var(--petrole-600);
  box-shadow: 0 0 0 3px rgba(28, 121, 126, 0.15);
  outline: none;
}
.popover .opt-check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  flex: none;
  color: var(--vert-600);
}
.popover button.opt.is-selected {
  background: var(--vert-50);
  color: var(--vert-ink);
  font-weight: 600;
}

/* Paramètres */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 6px 8px 6px 2px;
  border-radius: 8px;
  font: 700 18px var(--font-display);
  color: var(--ink);
}
.back-btn:hover {
  background: var(--line-2);
}
.card-title {
  margin: 0 0 4px;
  font: 700 16px var(--font-display);
}
.card-hint {
  margin: 0 0 12px;
}
.field-label.spaced {
  margin-top: 14px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-2);
}
.setting-row strong {
  display: block;
  font-weight: 600;
}
.setting-row span {
  color: var(--muted);
  font-size: 13px;
}
.account-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line-2);
  font-size: 14px;
}
.account-lines > div:first-child {
  border-top: 0;
}
.account-lines span {
  color: var(--muted);
}
.account-lines strong {
  text-align: right;
  overflow-wrap: anywhere;
}
.account-actions {
  margin-top: 14px;
}
.version-line {
  text-align: center;
}

/* Étape Expéditeur et badge Pro (doré, comme le CRM) */
.step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.step-title.flush {
  margin: 0;
}
.step-title.tight {
  margin-bottom: 6px;
}
.sender-card .hint {
  margin: 8px 2px 10px;
}
.pro-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fbbf24;
  color: #78350f;
  font: 700 11px var(--font);
  letter-spacing: 0.02em;
}
.btn-pro {
  background: #fbbf24;
  color: #78350f;
  font-weight: 700;
}
.btn-pro:hover {
  background: #f59e0b;
}
.switch input:disabled + span {
  opacity: 0.45;
}
.msg-warning.inline {
  margin: 10px 0 0;
}

/* Divers */
.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.name-fields .input {
  height: 36px;
  font-size: 14px;
}
.opt-flag {
  display: flex;
  gap: 10px;
  align-items: center;
}
.center-links.flat {
  border: 0;
  padding: 0;
}
.auth-head.centered {
  align-items: center;
}
.hint.flush {
  margin: 0;
}
.hint.is-error {
  color: var(--danger);
}
.editor-wrap {
  position: relative;
}
.scheduled-list.left,
.notice.left {
  text-align: left;
  margin-bottom: 16px;
}
