/* reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: linear-gradient(to right, #0033cc, #cc0000);
  color: #fff;
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* header */
.header {
  background: #0033cc;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 15px;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: color .3s;
}

.nav-links a:hover,
.nav-links a:focus {
  color: #cc0000;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* hero */
.hero {
  text-align: center;
  padding: 80px 20px;
}

.hero-img {
  max-width: 600px;
  width: 100%;
  border-radius: 10px;
  margin: 20px auto;
  display: block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* cards & services */
.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.card {
  background: #fff;
  color: #000;
  margin: 15px;
  padding: 20px;
  border-radius: 10px;
  width: 280px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  text-align: center;
}

.card:hover,
.card:focus-within {
  transform: translateY(-10px);
}

.card img,
.service-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* highlights, testimonials, cta */
.highlights,
.testimonials,
.cta {
  padding: 50px 20px;
  text-align: center;
}

.highlights {
  background: #fff;
  color: #000;
}

.testimonials {
  background: #0033cc;
  color: #fff;
}

.testimonials blockquote {
  font-style: italic;
  margin: 20px auto;
  max-width: 600px;
}

.cta {
  background: #cc0000;
  color: #fff;
}

/* forms */
.form {
  max-width: 500px;
  margin: 50px auto;
  background: #fff;
  color: #000;
  padding: 30px;
  border-radius: 10px;
}

.form label {
  display: block;
  margin-top: 10px;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
}

.btn {
  display: inline-block;
  background: #cc0000;
  color: #fff;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .3s;
}

.btn:hover,
.btn:focus {
  background: #0033cc;
}

.pulse {
  animation: pulse 2s infinite;
}

/* animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.fade-in {
  animation: fadeIn 2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 1.5s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* payment methods styling */
.payment-tranches,
.payment-methods {
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 5px;
  margin: 15px 0;
}

.payment-tranches legend,
.payment-methods legend {
  font-weight: bold;
  padding: 0 10px;
}

.method-option {
  padding: 12px;
  margin: 10px 0;
  background: #fafafa;
  border-radius: 4px;
  border-left: 3px solid #0033cc;
}

.method-option label {
  display: flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.method-option input[type="radio"] {
  width: auto;
  margin-right: 10px;
  cursor: pointer;
}

.method-description {
  margin: 8px 0 0 28px;
  font-size: 0.9rem;
  color: #666;
}

#payment-details {
  color: #000;
  font-size: 0.95rem;
}

#details-text {
  background: #fff;
  padding: 10px;
  border-radius: 3px;
  margin: 10px 0;
}

/* footer */
.footer {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}

/* responsive */
@media (max-width: 768px) {
  .cards {
    flex-direction: column;
    align-items: center;
  }
  .card {
    width: 90%;
  }

  .nav-links {
    flex-direction: column;
    gap: 10px;
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links.show {
    display: flex;
  }
}

/* Admin, commandes et tunnel de discussion */
.panel {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 24px;
  margin: 28px auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.form-intro,
.field-help,
.muted {
  color: #666;
  font-size: 0.95rem;
}

.field-help {
  display: block;
  margin-top: 6px;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 15px auto;
  font-weight: 600;
}

.alert-success {
  background: #e7f7ea;
  color: #126021;
  border: 1px solid #b6e4bf;
}

.alert-error {
  background: #fde8e8;
  color: #9b1c1c;
  border: 1px solid #f5b5b5;
}

.admin-container {
  width: 94%;
  max-width: 1200px;
  margin: 35px auto;
}

.admin-login {
  max-width: 520px;
}

.admin-login-form {
  margin: 20px 0 0;
  max-width: 100%;
  box-shadow: none;
  padding: 0;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.tab-link,
.btn-secondary {
  display: inline-block;
  background: #fff;
  color: #0033cc;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.tab-link.active {
  background: #0033cc;
  color: #fff;
}

.admin-form {
  margin: 18px 0;
}

.admin-form label,
.status-form label,
.chat-form label {
  display: block;
  margin-top: 12px;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.status-form select,
.chat-form textarea,
.admin-login-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 7px;
  margin-top: 6px;
}

.method-item {
  background: #f9f9f9;
  color: #111;
  padding: 16px;
  margin: 12px 0;
  border-left: 4px solid #0033cc;
  border-radius: 8px;
}

.method-item pre {
  background: #fff;
  padding: 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f4f6fb;
  color: #111;
}

.btn-small {
  padding: 7px 12px;
  font-size: 0.9rem;
}

.btn-danger {
  background: #a40000;
}

.btn-danger:hover,
.btn-danger:focus {
  background: #760000;
}

.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #eef2ff;
  color: #0033cc;
}

.status-terminee {
  background: #e7f7ea;
  color: #126021;
}

.status-annulee {
  background: #fde8e8;
  color: #9b1c1c;
}

.status-en_cours,
.status-en_discussion {
  background: #fff4d6;
  color: #755100;
}

.status-en_attente_paiement {
  background: #e9f2ff;
  color: #0f4c81;
}

.order-detail-head,
.order-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 20px;
  margin: 20px 0;
}

.initial-details {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 16px;
  margin: 18px 0;
}

.discussion-page {
  max-width: 980px;
}

.chat-box {
  background: #f3f5f9;
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0;
  max-height: 560px;
  overflow-y: auto;
}

.chat-message {
  max-width: 82%;
  padding: 14px;
  border-radius: 12px;
  margin: 12px 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.client-message {
  background: #fff;
  border-left: 4px solid #0033cc;
}

.admin-message {
  background: #ffecec;
  border-left: 4px solid #cc0000;
  margin-left: auto;
}

.chat-message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 8px;
}

.chat-form textarea {
  min-height: 130px;
  resize: vertical;
}

.chat-form .btn,
.admin-form .btn,
.status-form .btn,
.admin-login-form .btn {
  margin-top: 14px;
}

.confirmation-box {
  max-width: 720px;
  text-align: center;
}

.discussion-token {
  margin-top: 12px;
}

code {
  background: #f0f0f0;
  color: #111;
  padding: 2px 5px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .order-detail-head,
  .order-summary {
    flex-direction: column;
  }

  .chat-message {
    max-width: 100%;
  }

  .admin-table th,
  .admin-table td {
    padding: 9px;
    font-size: 0.9rem;
  }
}


/* PWA, notifications et page commande modernisée */
.install-app-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  align-items: center;
  gap: 8px;
  background: #0033cc;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.live-notification-toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 10000;
  width: min(360px, calc(100vw - 36px));
  background: #fff;
  color: #111;
  border-left: 5px solid #cc0000;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  transform: translateY(-130%);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  cursor: pointer;
}

.live-notification-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.live-notification-toast strong,
.live-notification-toast span {
  display: block;
}

.live-notification-toast span {
  color: #555;
  margin-top: 4px;
  font-size: .95rem;
}

.notification-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.notification-panel h2 {
  margin-bottom: 4px;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-badge {
  display: none;
  background: #cc0000;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
}

.live-badge.show {
  display: inline-flex;
}

[data-notification-trigger].is-enabled {
  background: #126021;
  color: #fff;
}

.order-modern-page {
  padding-bottom: 20px;
}

.order-hero-modern {
  padding: 52px 0 28px;
}

.order-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 26px;
  align-items: stretch;
}

.order-hero-modern h2 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.05;
  max-width: 780px;
  margin: 10px 0 16px;
}

.order-hero-modern p {
  max-width: 720px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, .92);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.order-steps-card {
  background: rgba(255, 255, 255, .96);
  color: #111;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
  display: grid;
  gap: 12px;
}

.order-steps-card div {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f4f6fb;
  border-radius: 16px;
  padding: 13px;
}

.order-steps-card strong {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0033cc;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modern-order-form {
  max-width: 980px;
  border-radius: 24px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .26);
}

.form-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.form-title-row .eyebrow {
  color: #0033cc;
  background: #eef2ff;
  border-color: #dbe4ff;
}

.form-title-row h2 {
  margin-top: 8px;
  color: #101828;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.form-chip {
  display: inline-flex;
  background: #e7f7ea;
  color: #126021;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  white-space: nowrap;
}

.form-section-card {
  background: #f8faff;
  border: 1px solid #e6ebf5;
  border-radius: 18px;
  padding: 20px;
  margin-top: 18px;
}

.form-section-card h3 {
  color: #101828;
  margin-bottom: 14px;
}

.order-form-grid.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.input-group.full-width {
  grid-column: 1 / -1;
}

.input-group label {
  font-weight: 800;
  color: #253047;
  margin-top: 0;
}

.form input,
.form select,
.form textarea,
.admin-form input,
.admin-form textarea,
.status-form select,
.chat-form textarea,
.admin-login-form input {
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 12px 13px;
  font: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.admin-form input:focus,
.admin-form textarea:focus,
.status-form select:focus,
.chat-form textarea:focus,
.admin-login-form input:focus {
  border-color: #0033cc;
  box-shadow: 0 0 0 4px rgba(0, 51, 204, .12);
}

.service-help {
  color: #0f4c81;
  background: #e9f2ff;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: .9rem;
  margin-top: 8px;
}

.radio-pill-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-pill-group label {
  margin: 0;
  cursor: pointer;
}

.radio-pill-group input {
  width: auto;
  margin-right: 6px;
}

.radio-pill-group span,
.method-option {
  border-radius: 14px;
}

.form-actions-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.form-actions-modern p {
  color: #667085;
  max-width: 420px;
}

.modern-order-form .btn {
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 900;
}

@media (max-width: 820px) {
  .order-hero-grid,
  .order-form-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .notification-panel,
  .form-title-row,
  .form-actions-modern {
    align-items: stretch;
    flex-direction: column;
  }

  .input-group.full-width {
    grid-column: auto;
  }

  .install-app-btn {
    left: 16px;
    right: 16px;
    justify-content: center;
  }
}

/* --- PWA visible installation + discussion resume --- */
.install-app-btn,
.resume-discussion-btn {
  position: fixed;
  z-index: 9998;
  right: 18px;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.install-app-btn {
  bottom: 18px;
  background: #0033cc;
  color: #fff;
}

.install-app-btn.ready {
  background: #ff8a00;
  color: #111827;
}

.resume-discussion-btn {
  bottom: 76px;
  background: #101828;
  color: #fff;
}

.install-app-btn:hover,
.resume-discussion-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

.pwa-help-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 15, 25, .62);
  backdrop-filter: blur(6px);
}

.pwa-help-modal.show {
  display: flex;
}

.pwa-help-box {
  position: relative;
  width: min(520px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.pwa-help-box h2 {
  margin: 0 0 12px;
  color: #0f172a;
}

.pwa-help-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f2f4f7;
  font-size: 24px;
  cursor: pointer;
}

/* --- Discussion access + media chat --- */
.discussion-access-card,
.continue-card {
  max-width: 920px;
  margin: 34px auto;
}

.discussion-access-form {
  margin-top: 18px;
}

.discussion-access-form input,
.copy-link-input,
.media-chat-form input[type="file"] {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: #fff;
}

.copy-link-input {
  margin-top: 10px;
  color: #344054;
  background: #f8fafc;
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.resume-local-box {
  margin-top: 20px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 16px;
  background: #eff6ff;
}

.media-chat-form {
  gap: 10px;
}

.media-upload-label {
  margin-top: 10px;
  font-weight: 800;
}

.field-help {
  display: block;
  color: #667085;
  font-size: .9rem;
}

.chat-message p:empty {
  display: none;
}

.chat-attachment {
  margin: 10px 0 0;
}

.chat-attachment img,
.chat-attachment video {
  display: block;
  max-width: min(420px, 100%);
  max-height: 420px;
  border-radius: 16px;
  object-fit: contain;
  background: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}

.chat-attachment figcaption,
.chat-attachment-file {
  margin-top: 7px;
  color: #475467;
  font-size: .88rem;
}

.chat-attachment-file a {
  color: #0033cc;
  font-weight: 800;
}

@media (max-width: 820px) {
  .continue-card {
    align-items: stretch;
    flex-direction: column;
  }

  .install-app-btn,
  .resume-discussion-btn {
    left: 14px;
    right: 14px;
    text-align: center;
    justify-content: center;
  }

  .resume-discussion-btn {
    bottom: 74px;
  }
}

/* --- Sélecteur de langue côté client --- */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo a {
  color: inherit;
  text-decoration: none;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  color: #fff;
  font-weight: 700;
}

.language-switcher label {
  font-size: .9rem;
}

.language-switcher select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  padding: 7px 34px 7px 12px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.language-switcher select option {
  color: #111;
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .language-switcher {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .language-switcher select {
    width: min(220px, 100%);
  }
}
