/**
 * sentruck-global.css
 * Styles partagés pour toutes les pages front-end SENTRUCK.
 * Palette : vert foncé #1a3a2e / or #e8a020 / blanc / gris clair
 */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --stk-green:       #1a3a2e;
  --stk-green-light: #2a5c46;
  --stk-gold:        #e8a020;
  --stk-gold-light:  #f5c05a;
  --stk-white:       #ffffff;
  --stk-bg:          #f5f6f4;
  --stk-border:      #d8ddd6;
  --stk-text:        #1a1a1a;
  --stk-text-muted:  #666666;
  --stk-success:     #1a7a4a;
  --stk-error:       #c0392b;
  --stk-warning:     #e67e22;
  --stk-radius:      8px;
  --stk-shadow:      0 2px 8px rgba(0,0,0,0.08);
}

/* ── Reset & base ──────────────────────────────────────────── */
.stk-page { background: var(--stk-bg); min-height: 100vh; }

.stk-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* ── Page header ────────────────────────────────────────────── */
.stk-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.stk-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--stk-green);
  margin: 0 0 24px;
}

/* ── Formulaire ─────────────────────────────────────────────── */
.stk-form-section {
  background: var(--stk-white);
  border: 1px solid var(--stk-border);
  border-radius: var(--stk-radius);
  padding: 24px;
  margin-bottom: 20px;
}

.stk-form-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--stk-green);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--stk-gold);
}

.stk-form-row {
  margin-bottom: 16px;
}

.stk-form-row label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--stk-text);
  margin-bottom: 6px;
}

.stk-form-row input[type="text"],
.stk-form-row input[type="email"],
.stk-form-row input[type="tel"],
.stk-form-row input[type="number"],
.stk-form-row input[type="date"],
.stk-form-row input[type="file"],
.stk-form-row input[type="password"],
.stk-form-row select,
.stk-form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--stk-border);
  border-radius: var(--stk-radius);
  font-size: 14px;
  color: var(--stk-text);
  background: var(--stk-white);
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.stk-form-row input:focus,
.stk-form-row select:focus,
.stk-form-row textarea:focus {
  outline: none;
  border-color: var(--stk-green);
  box-shadow: 0 0 0 3px rgba(26,58,46,0.1);
}

.stk-form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .stk-form-row-2col { grid-template-columns: 1fr; }
}

/* ── Radio groups ───────────────────────────────────────────── */
.stk-radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stk-radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid var(--stk-border);
  border-radius: var(--stk-radius);
  cursor: pointer;
  flex: 1;
  min-width: 200px;
  transition: border-color 0.15s, background 0.15s;
}

.stk-radio-label:has(input:checked) {
  border-color: var(--stk-green);
  background: rgba(26,58,46,0.04);
}

.stk-radio-label span { font-weight: 600; font-size: 14px; }
.stk-radio-label small { display: block; color: var(--stk-text-muted); font-size: 12px; margin-top: 2px; }

/* ── Boutons ────────────────────────────────────────────────── */
.stk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--stk-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.stk-btn-primary   { background: var(--stk-green); color: var(--stk-white); }
.stk-btn-primary:hover { background: var(--stk-green-light); }
.stk-btn-secondary { background: var(--stk-gold); color: var(--stk-white); }
.stk-btn-secondary:hover { background: var(--stk-gold-light); }
.stk-btn-ghost     { background: transparent; color: var(--stk-green); border: 1px solid var(--stk-border); }
.stk-btn-ghost:hover { background: var(--stk-bg); }
.stk-btn-danger    { background: var(--stk-error); color: var(--stk-white); }
.stk-btn-sm        { padding: 6px 12px; font-size: 12px; }
.stk-btn:disabled  { opacity: 0.5; cursor: not-allowed; }

.stk-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ── Messages ───────────────────────────────────────────────── */
.stk-message {
  padding: 12px 16px;
  border-radius: var(--stk-radius);
  font-size: 14px;
  margin-top: 16px;
}

.stk-message-success { background: #e8f5ee; color: var(--stk-success); border: 1px solid #b6dfc8; }
.stk-message-error   { background: #fdecea; color: var(--stk-error);   border: 1px solid #f5b7b1; }

/* ── Erreurs par champ ───────────────────────────────────────── */
.stk-field-error {
  display: block;
  font-size: 12px;
  color: var(--stk-error);
  margin-top: 4px;
}
.stk-field-invalid {
  border-color: var(--stk-error) !important;
  background: #fff8f7 !important;
}

/* ── Statuts ─────────────────────────────────────────────────── */
.stk-account-status {
  padding: 12px 16px;
  border-radius: var(--stk-radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.stk-status-pending  { background: #fef9e7; color: #8e6a00; border: 1px solid #f5d77a; }
.stk-status-active   { background: #e8f5ee; color: var(--stk-success); border: 1px solid #b6dfc8; }
.stk-status-rejected { background: #fdecea; color: var(--stk-error); border: 1px solid #f5b7b1; }
.stk-status-blocked  { background: #f4f4f4; color: #555; border: 1px solid var(--stk-border); }

/* Vérification niveau 2 */
.stk-status-verified-none     { background: #f4f4f4; color: #555; border: 1px solid var(--stk-border); }
.stk-status-verified-pending  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.stk-status-verified-verified { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.stk-status-verified-rejected { background: #fdecea; color: var(--stk-error); border: 1px solid #f5b7b1; }

.stk-badge-verified-label {
  font-size: 13px;
  font-weight: 500;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Documents ──────────────────────────────────────────────── */
.stk-document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--stk-border);
  flex-wrap: wrap;
  gap: 8px;
}

.stk-doc-info   { display: flex; flex-direction: column; gap: 4px; }
.stk-doc-label  { font-weight: 500; font-size: 14px; }
.stk-doc-status { font-size: 12px; }
.stk-doc-status-pending   { color: var(--stk-warning); }
.stk-doc-status-validated { color: var(--stk-success); }
.stk-doc-status-rejected  { color: var(--stk-error); }
.stk-doc-status-missing   { color: var(--stk-text-muted); }

.stk-doc-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.stk-upload-btn {
  display: inline-flex;
  padding: 6px 12px;
  background: var(--stk-bg);
  border: 1px solid var(--stk-border);
  border-radius: var(--stk-radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--stk-text);
}

.stk-doc-view-btn { font-size: 12px; color: var(--stk-green); text-decoration: underline; }
.stk-upload-progress { font-size: 12px; color: var(--stk-text-muted); }

/* ── Vehicles grid ───────────────────────────────────────────── */
.stk-vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.stk-vehicle-card {
  background: var(--stk-white);
  border: 1px solid var(--stk-border);
  border-radius: var(--stk-radius);
  overflow: hidden;
  box-shadow: var(--stk-shadow);
}

.stk-vehicle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--stk-green);
  color: var(--stk-white);
}

.stk-vehicle-type   { font-weight: 600; font-size: 15px; }
.stk-vehicle-status { font-size: 12px; opacity: 0.9; }
.stk-vehicle-body   { padding: 14px 16px; font-size: 14px; }
.stk-vehicle-body p { margin: 4px 0; }

.stk-doc-link {
  display: block;
  font-size: 12px;
  color: var(--stk-green);
  text-decoration: underline;
  margin-top: 6px;
}

.stk-vehicle-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--stk-border);
  flex-wrap: wrap;
}

/* ── Stats ──────────────────────────────────────────────────── */
.stk-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stk-stat-box {
  flex: 1;
  min-width: 120px;
  background: var(--stk-bg);
  border-radius: var(--stk-radius);
  padding: 16px;
  text-align: center;
}

.stk-stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--stk-green); }
.stk-stat-label { display: block; font-size: 12px; color: var(--stk-text-muted); margin-top: 4px; }

/* ── Modal ──────────────────────────────────────────────────── */
.stk-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.stk-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }

.stk-modal-box {
  position: relative;
  background: var(--stk-white);
  border-radius: var(--stk-radius);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.stk-modal-box h2 { margin: 0 0 20px; color: var(--stk-green); font-size: 18px; }

/* ── Empty state ────────────────────────────────────────────── */
.stk-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--stk-white);
  border: 2px dashed var(--stk-border);
  border-radius: var(--stk-radius);
  color: var(--stk-text-muted);
}

/* ── Help text ──────────────────────────────────────────────── */
.stk-help-text { font-size: 13px; color: var(--stk-text-muted); margin: 0 0 16px; }
.stk-required-note { font-size: 12px; font-weight: 400; color: var(--stk-text-muted); }

/* ── Sub-blocs ──────────────────────────────────────────────── */
.stk-sub-bloc {
  background: #f9faf8;
  border-left: 3px solid var(--stk-gold);
  border-radius: 0 var(--stk-radius) var(--stk-radius) 0;
  padding: 16px;
  margin: 12px 0;
}

.stk-arret-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* ── Dashboard ──────────────────────────────────────────────── */
.stk-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.stk-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Lignes de liste (demandes / offres) ────────────────────── */
.stk-requests-list { display: flex; flex-direction: column; gap: 0; }

.stk-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--stk-border);
  gap: 12px;
  flex-wrap: wrap;
}
.stk-request-row:last-child { border-bottom: none; }

.stk-request-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.stk-request-route {
  font-weight: 600;
  font-size: 14px;
  color: var(--stk-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stk-request-meta {
  font-size: 12px;
  color: var(--stk-text-muted);
}

/* ── Badges statut ──────────────────────────────────────────── */
.stk-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.stk-badge-draft     { background: #f0f0f0; color: #666; }
.stk-badge-published { background: #e8f0fe; color: #1a56db; }
.stk-badge-offers    { background: #fef3c7; color: #92400e; }
.stk-badge-selected  { background: #e8f5ee; color: var(--stk-success); }
.stk-badge-closed    { background: #f0f0f0; color: #666; }
.stk-badge-complexe  { background: #f0f7f4; color: var(--stk-green); font-weight: 600; }

.stk-arret-row input { flex: 1; }

/* ── Badges supplémentaires ─────────────────────────────────── */
.stk-badge-warning { background: #fef3c7; color: #92400e; }
.stk-badge-info    { background: #e0f2fe; color: #075985; }
.stk-badge-success { background: #dcfce7; color: #166534; }
.stk-badge-danger  { background: #fee2e2; color: #991b1b; }

/* ── Info grid (détail commande) ────────────────────────────── */
.stk-info-grid { display: flex; flex-direction: column; gap: 0; }
.stk-info-row  {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--stk-border);
  gap: 12px;
}
.stk-info-row:last-child { border-bottom: none; }
.stk-info-label { color: var(--stk-text-muted); font-size: 13px; flex-shrink: 0; }
.stk-info-value { font-weight: 500; text-align: right; }

/* ── Price summary ──────────────────────────────────────────── */
.stk-price-summary { display: flex; flex-direction: column; gap: 0; }
.stk-price-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--stk-border);
  font-size: 14px;
}
.stk-price-row:last-child { border-bottom: none; }
.stk-price-total {
  font-weight: 700;
  font-size: 16px;
  color: var(--stk-green);
  padding-top: 14px;
}

/* ── Empty state ────────────────────────────────────────────── */
.stk-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--stk-text-muted);
}
.stk-empty-state p { margin-bottom: 16px; font-size: 15px; }

/* ── Request footer (dans list) ─────────────────────────────── */
.stk-request-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Button sm ──────────────────────────────────────────────── */
.stk-btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* ── Account status variants ────────────────────────────────── */
.stk-status-info    { background: #e0f2fe; color: #075985; }
.stk-status-success { background: #dcfce7; color: #166534; }
.stk-status-warning { background: #fef3c7; color: #92400e; }
.stk-status-danger  { background: #fee2e2; color: #991b1b; }

/* ── Star rating ────────────────────────────────────────────── */
.stk-star-rating { display: flex; gap: 6px; cursor: pointer; font-size: 28px; }
.stk-star        { color: #d1d5db; transition: color 0.1s; user-select: none; }
.stk-star-active { color: #e8a020; }

/* ── Upload area ────────────────────────────────────────────── */
.stk-upload-area {
  border: 2px dashed var(--stk-border);
  border-radius: var(--stk-radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.stk-upload-area:hover { border-color: var(--stk-green); }
.stk-upload-area input[type="file"] { display: block; margin: 0 auto; }
.stk-upload-hint { color: var(--stk-text-muted); font-size: 13px; margin-top: 8px; }

/* ── Mot de passe (wrapper + bouton Afficher/Masquer) ───────── */
.stk-pass-wrapper {
  position: relative;
}
.stk-pass-wrapper input[type="password"],
.stk-pass-wrapper input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding-right: 80px;
  background: inherit;
}
.stk-pass-wrapper .stk-toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding: 0;
  line-height: 1;
  white-space: nowrap;
}
.stk-pass-wrapper .stk-toggle-pass:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ── Onglets rôle (shortcode inscription) ───────────────────── */
.stk-role-tabs {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--stk-border);
  margin-bottom: 28px;
}
.stk-role-tab {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
  transition: background 0.2s, color 0.2s;
}
.stk-role-tab.stk-role-tab--active {
  background: #ffffff;
  color: var(--stk-green);
}
.stk-role-tab:not(.stk-role-tab--active):hover {
  color: rgba(255, 255, 255, 0.75);
}

/* ── Bouton doré (shortcode CTA) ────────────────────────────── */
.stk-btn-gold {
  background: var(--stk-gold) !important;
  color: #1a2e1a !important;
  font-weight: 700;
}
.stk-btn-gold:hover {
  opacity: 0.9;
}
