/* ============================================================
   TRAVBAT - Style global
   ============================================================ */
:root {
  /* === Palette MARINE V6 === */
  --primary: #1A2B47;          /* Bleu nuit Marine */
  --primary-light: #4A5874;
  --accent: #E85A2A;           /* Orange chaleureux */
  --accent-hover: #C04416;
  --success: #16A34A;          /* Vert validation */
  --warning: #FBBF24;          /* Jaune doré */
  --danger: #dc2626;
  --bg: #F8FAFC;               /* Blanc bleuté */
  --bg-soft: #EEF2F7;
  --bg-card: #ffffff;
  --border: rgba(26, 43, 71, 0.08);
  --border-strong: rgba(26, 43, 71, 0.15);
  --text: #1A2B47;
  --text-light: #8B96AE;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-relief: 0 2px 0 rgba(0,0,0,0.1), 0 3px 8px -2px rgba(26, 43, 71, 0.15);
  --shadow-relief-hover: 0 3px 0 rgba(0,0,0,0.12), 0 6px 14px -3px rgba(232, 90, 42, 0.25);
  --radius: 12px;
  --radius-sm: 8px;
  /* Polices Marine V6 */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-italic: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--primary); margin-bottom: 0.5em; line-height: 1.2; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
h1 em, h2 em, h3 em { font-family: var(--font-italic); font-style: italic; font-weight: 500; color: var(--accent); letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1em; }
img { max-width: 100%; height: auto; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* === Container === */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.container-sm { max-width: 600px; margin: 0 auto; padding: 20px; }
.container-md { max-width: 900px; margin: 0 auto; padding: 20px; }

/* === Header === */
.header {
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.logo { font-size: 1.4rem; font-weight: 800; color: #fff !important; text-decoration: none; }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.nav a { color: #fff; opacity: 0.85; }
.nav a:hover { opacity: 1; text-decoration: none; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; background: var(--accent); color: #fff !important;
  border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-success { background: var(--success); }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff !important; }
.btn-outline { background: transparent; color: var(--accent) !important; border: 2px solid var(--accent); }
.btn-outline:hover:not(:disabled) { background: var(--accent); color: #fff !important; }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--text); }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s; color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-control:invalid:not(:placeholder-shown) { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475569' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; appearance: none; }
.form-help { font-size: 0.82rem; color: var(--text-light); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }

/* === Cards === */
.card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }

/* === Alerts === */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; font-size: 0.95rem; }
.alert-success { background: #dcfce7; color: #14532d; border-left: 4px solid var(--success); }
.alert-error { background: #fee2e2; color: #7f1d1d; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3c7; color: #78350f; border-left: 4px solid var(--warning); }
.alert-info { background: #FFEAE0; color: #1e3a8a; border-left: 4px solid var(--accent); }

/* === Hero === */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; padding: 60px 20px; text-align: center; }
.hero h1 { color: #fff; font-size: 2.5rem; margin-bottom: 16px; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 700px; margin: 0 auto 24px; }

/* === Features grid === */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 30px 0; }
.feature-card { background: #fff; padding: 28px 20px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); transition: transform 0.2s; }
.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2.8rem; margin-bottom: 12px; }

/* === Plans / Pricing === */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 30px 0; }
.plan-card { background: #fff; padding: 28px 20px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; border: 2px solid transparent; position: relative; }
.plan-card.popular { border-color: var(--accent); transform: scale(1.03); }
.plan-card.popular::before { content: "⭐ POPULAIRE"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.plan-price { font-size: 2.2rem; font-weight: 800; color: var(--primary); margin: 12px 0; }
.plan-price span { font-size: 0.9rem; font-weight: 400; color: var(--text-light); }
.plan-features { list-style: none; text-align: left; margin: 20px 0; }
.plan-features li { padding: 6px 0; padding-left: 26px; position: relative; font-size: 0.92rem; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }

/* === Dashboard === */
.dashboard-grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; min-height: calc(100vh - 80px); }
.sidebar { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); height: fit-content; position: sticky; top: 80px; }
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a { display: block; padding: 9px 12px; color: var(--text); border-radius: var(--radius-sm); transition: background 0.2s, color 0.2s; text-decoration: none; font-size: 0.92rem; }
.sidebar-nav a:hover { background: var(--bg); }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin-top: 4px; }

/* === Tables === */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table th { background: #f1f5f9; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover { background: #f8fafc; }
.table-responsive { overflow-x: auto; }

/* === Badges === */
.badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #14532d; }
.badge-warning { background: #fef3c7; color: #78350f; }
.badge-danger { background: #fee2e2; color: #7f1d1d; }
.badge-info { background: #FFEAE0; color: #1e3a8a; }

/* === Signature canvas === */
.signature-pad { width: 100%; background: #fff; border: 2px dashed var(--border); border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; }

/* === AI Chat === */
.chat-container { background: #fff; border-radius: var(--radius); height: 500px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.chat-messages { flex: 1; padding: 16px; overflow-y: auto; }
.chat-message { margin-bottom: 10px; padding: 10px 14px; border-radius: 12px; max-width: 85%; word-wrap: break-word; }
.chat-message.user { background: var(--accent); color: #fff; margin-left: auto; }
.chat-message.assistant { background: #f1f5f9; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

/* === Cookie banner === */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--primary); color: #fff; padding: 16px 20px; z-index: 999; box-shadow: 0 -4px 12px rgba(0,0,0,0.1); display: none; }
.cookie-banner.show { display: block; }
.cookie-banner-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cookie-banner p { margin: 0; flex: 1; font-size: 0.9rem; min-width: 200px; }
.cookie-banner a { color: #93c5fd; }

/* === Footer === */
.footer { background: var(--primary); color: #fff; padding: 30px 20px; text-align: center; margin-top: 40px; }
.footer a { color: #93c5fd; }
.footer p { margin-bottom: 4px; }

/* === Utilities === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.text-light { color: var(--text-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.hidden { display: none !important; }

/* === Mobile === */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .hero { padding: 40px 16px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .header { padding: 12px 16px; }
  .header-inner { flex-direction: column; gap: 8px; }
  .nav { flex-wrap: wrap; justify-content: center; gap: 12px; }
  .nav a { font-size: 0.9rem; }
  .plan-card.popular { transform: none; }
  .container, .container-sm, .container-md { padding: 12px; }
  
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: 0; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar-nav li { flex: 1 1 auto; min-width: 130px; }
  .sidebar-nav a { text-align: center; font-size: 0.82rem; padding: 8px 4px; }
  
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.4rem; }
  
  .table { font-size: 0.85rem; }
  .table th, .table td { padding: 8px 6px; }
  
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  
  .btn { padding: 10px 18px; font-size: 0.95rem; }
  .btn-lg { padding: 14px 24px; font-size: 1rem; }
}
