/* Thème repris de tomas.fr : orange #f18346, marine #1b2a47, Open Sans */
:root {
  --ink: #1b2a47;
  --ink-soft: #4b5876;
  --paper: #f0f2f6;
  --surface: #ffffff;
  --line: rgba(27, 42, 71, 0.12);
  --line-strong: rgba(27, 42, 71, 0.24);
  --steel: #6b7690;
  --accent: #f18346;
  --accent-strong: #d96a30;
  --accent-wash: rgba(241, 131, 70, 0.12);
  --ok: #2f8f5b;
  --ok-wash: rgba(47, 143, 91, 0.14);
  --warn: #c23b2e;
  --warn-wash: rgba(194, 59, 46, 0.12);
  --shadow: 0 1px 2px rgba(27, 42, 71, 0.06), 0 6px 20px -8px rgba(27, 42, 71, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

a { color: var(--accent-strong); }
body { line-height: 1.6; }

.app-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; padding: 14px 32px;
}
.app-banner-logo { height: 26px; display: block; }
.btn.small { padding: 7px 14px; font-size: 12.5px; }

.wrap { max-width: 900px; margin: 0 auto; padding: 40px 24px 80px; flex: 1; width: 100%; }

.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  margin-bottom: 28px;
}
.banner.ok { background: var(--ok-wash); color: var(--ok); }
.banner.warn { background: var(--warn-wash); color: var(--warn); }

h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: 0; }
.subtitle { color: var(--ink-soft); font-size: 14px; margin: 0 0 32px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 24px;
}
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; letter-spacing: 0; }
.card-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-header-row .btn { flex-shrink: 0; }

.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 11px 0; border-top: 1px solid var(--line); font-size: 13.5px;
}
.info-row:first-child { border-top: none; padding-top: 4px; }
.info-row .info-label { color: var(--steel); flex-shrink: 0; }
.info-row .info-value { color: var(--ink); font-weight: 600; text-align: right; }
.card .card-hint { font-size: 12.5px; color: var(--steel); margin: 0 0 16px; }
.card.primary-action { border-top: 3px solid var(--accent); }

.offer-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.offer-option {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 8px;
  border: 1.5px solid var(--line-strong); cursor: pointer; position: relative;
}
.offer-option input { position: absolute; top: 14px; right: 14px; accent-color: var(--accent); }
.offer-option:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.offer-option.disabled { cursor: not-allowed; opacity: 0.5; }
.offer-option.disabled:has(input:checked) { border-color: var(--line-strong); background: none; }
.offer-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.offer-price { font-size: 13px; color: var(--ink-soft); }
.offer-hint { font-size: 11.5px; color: var(--steel); }

.qty-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.qty-label { display: flex; flex-direction: column; gap: 2px; }
.qty-label strong { font-size: 14px; color: var(--ink); }
.qty-label span { font-size: 12px; color: var(--steel); }
.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-stepper input {
  width: 40px; text-align: center; font: inherit; font-weight: 700; font-size: 15px;
  border: none; background: transparent; color: var(--ink);
}
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; border-color: var(--line); color: var(--steel); }
.qty-btn:disabled:hover { border-color: var(--line); color: var(--steel); }

@media (max-width: 480px) {
  .offer-picker { grid-template-columns: 1fr; }
}

.sub-summary { margin-bottom: 14px; }
.sub-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 5px 0; color: var(--ink-soft); }
.sub-line-amt { font-variant-numeric: tabular-nums; }
.sub-line.sub-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-weight: 700; color: var(--ink); }

.field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span2 { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--steel); }
.field input {
  font: inherit; font-size: 13.5px; padding: 9px 11px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  width: 100%; min-width: 0; box-sizing: border-box;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input:disabled, .field select:disabled {
  background: transparent; border-color: transparent; color: var(--ink);
  cursor: default; opacity: 1; -webkit-text-fill-color: var(--ink);
}
.field input.field-error { border-color: var(--warn); outline: 2px solid var(--warn-wash); }
.field .required-hint { font-size: 11px; color: var(--warn); }

.field select {
  font: inherit; font-size: 13.5px; padding: 9px 11px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  width: 100%; min-width: 0; box-sizing: border-box;
}
.phone-field { display: flex; gap: 8px; min-width: 0; }
.phone-field select { flex: 0 0 40%; min-width: 0; }
.phone-field input { flex: 1; min-width: 0; }

@media (max-width: 480px) {
  .phone-field { flex-direction: column; }
  .phone-field select { flex: 1; }
}

.save-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.save-msg { font-size: 12.5px; color: var(--ok); align-self: center; display: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.invoices { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.inv-row {
  display: grid; grid-template-columns: 100px 1fr 90px 50px;
  grid-template-areas: "date status amt pdf";
  align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px;
}
.inv-row .inv-date { grid-area: date; }
.inv-row .status { grid-area: status; color: var(--ok); font-size: 12px; }
.inv-row .amt { grid-area: amt; text-align: right; font-variant-numeric: tabular-nums; }
.inv-row .inv-pdf { grid-area: pdf; text-align: right; }
.inv-row.head { background: var(--paper); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--steel); }
.inv-row.head .status, .inv-row.head .amt { color: var(--steel); }
.inv-row:not(.head) + .inv-row { border-top: 1px solid var(--line); }
.inv-empty { padding: 16px; text-align: center; color: var(--steel); font-size: 13px; }

.inv-pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 14px; font-size: 13px; color: var(--steel);
}
.inv-page-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line-strong);
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.inv-page-btn:hover { background: var(--paper); }
.inv-page-btn.disabled { opacity: 0.35; pointer-events: none; }

.cta-row { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 600; padding: 13px 18px; border-radius: 5px;
  text-decoration: none; border: none; cursor: pointer; font-family: inherit;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 -3px rgba(0, 0, 0, 0.1) inset; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent-strong); }
.btn.outline:hover { background: var(--accent-wash); }

.demo-flag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-strong);
  background: var(--accent-wash); padding: 4px 10px; border-radius: 999px; margin-bottom: 18px;
}

.login-wrap {
  max-width: 420px; margin: 8vh auto; padding: 0 24px; flex: 1; width: 100%;
}
.login-wrap .card { padding: 28px; }
.login-wrap h1 { font-size: 20px; }
.field-simple { display: flex; flex-direction: column; gap: 6px; margin: 18px 0; }
.field-simple label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field-simple input { font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line-strong); }
.helptext { font-size: 12.5px; color: var(--steel); margin-top: 10px; overflow-wrap: anywhere; }

/* Login — split-screen : photo de chantier + formulaire épuré */
.split-auth { display: flex; min-height: 100vh; flex: 1; }

.photo-panel {
  flex: 1 1 55%; position: relative; overflow: hidden;
  background: url('hero-artisan.jpg') center/cover no-repeat;
}
.photo-panel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(27, 42, 71, 0.25) 0%, rgba(27, 42, 71, 0.05) 35%, rgba(27, 42, 71, 0.88) 100%);
}
.photo-brand {
  position: absolute; top: 32px; left: 40px; z-index: 1;
}
.photo-brand img { height: 26px; display: block; }
.photo-quote { position: absolute; left: 40px; right: 40px; bottom: 40px; z-index: 1; color: #fff; }
.photo-quote p { font-size: 22px; font-weight: 600; line-height: 1.4; margin: 0 0 8px; max-width: 420px; letter-spacing: 0; }
.photo-quote span { font-size: 13px; color: rgba(255, 255, 255, 0.72); }

.form-panel {
  flex: 1 1 45%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface); padding: 40px 24px;
}

.auth-card {
  width: 100%; max-width: 360px; text-align: center;
}
.auth-card-logo { height: 32px; display: block; margin: 0 auto 24px; }
.auth-card h1 { font-size: 24px; font-weight: 400; margin: 0 0 8px; letter-spacing: 0; }
.auth-card .subtitle { font-size: 15px; margin: 0 0 32px; }
.auth-card form { text-align: left; }
.auth-card .field-simple { margin: 0 0 28px; }
.auth-card .field-simple input { padding: 13px 15px; border-radius: 4px; font-size: 15px; }
.auth-card .field-simple input:focus { outline: none; border: 2px solid var(--accent); padding: 12px 14px; }
.auth-card .banner, .auth-card .demo-flag { text-align: left; }

.auth-actions { display: flex; justify-content: flex-end; }
.auth-actions .btn { width: auto; padding: 10px 24px; border-radius: 4px; }

.google-footer { margin-top: 32px; width: 100%; max-width: 360px; }
.google-footer .links { display: flex; gap: 28px; font-size: 12.5px; color: var(--steel); }
.google-footer .links a { color: var(--steel); text-decoration: none; }
.google-footer .links a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .photo-panel { display: none; }
  .form-panel { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .google-footer .links { gap: 20px; }
}

.site-footer {
  background: var(--ink); color: rgba(255, 255, 255, 0.6);
  padding: 26px 32px; margin-top: 48px; font-size: 12.5px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.site-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .links { display: flex; gap: 18px; }

@media (max-width: 640px) {
  .app-banner { padding: 12px 16px; }
  .app-banner-logo { height: 20px; }
  .wrap { padding: 24px 16px 60px; }
  .card { padding: 18px 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .field.span2 { grid-column: auto; }

  .inv-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date amt" "status pdf";
    row-gap: 4px;
  }
  .inv-row.head { display: none; }

  .site-footer { flex-direction: column; align-items: flex-start; padding: 20px 16px; }

  .btn { flex-direction: column; align-items: flex-start; gap: 4px; }
}
