/* AgriVox — couche Compte producteur et suivi d'usage.
   Feuille de style autonome, indépendante du bundle applicatif. */

:root {
  --av-vert: #14532d;
  --av-vert-clair: #1b6b3a;
  --av-vert-pale: #e8f3ec;
  --av-or: #d97706;
  --av-texte: #10261a;
  --av-gris: #6b7c72;
  --av-bord: #d6e3da;
  --av-rouge: #b42318;
}

#av-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: linear-gradient(165deg, #0f3d22 0%, #14532d 45%, #0b2b17 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: "General Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--av-texte);
  padding: 0;
}

#av-gate * {
  box-sizing: border-box;
}

.av-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 40px;
}

.av-head {
  text-align: center;
  color: #fff;
  padding: 8px 0 22px;
}

.av-logo {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  object-fit: cover;
  background: #fff;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.av-head h1 {
  margin: 14px 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.av-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.85;
}

.av-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px 18px 22px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.av-tabs {
  display: flex;
  background: var(--av-vert-pale);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 18px;
}

.av-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 11px 8px;
  border-radius: 11px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--av-gris);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.av-tab[aria-selected="true"] {
  background: #fff;
  color: var(--av-vert);
  box-shadow: 0 2px 8px rgba(20, 83, 45, 0.14);
}

.av-field {
  margin-bottom: 13px;
}

.av-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--av-texte);
}

.av-field .av-opt {
  font-weight: 500;
  color: var(--av-gris);
}

.av-field input,
.av-field select {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--av-bord);
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  color: var(--av-texte);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.av-field input:focus,
.av-field select:focus {
  border-color: var(--av-vert-clair);
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.14);
}

.av-phone {
  display: flex;
  gap: 8px;
}

.av-phone select {
  flex: 0 0 138px;
  padding-left: 10px;
  padding-right: 4px;
  font-size: 14px;
}

.av-phone input {
  flex: 1;
  min-width: 0;
}

.av-pass-wrap {
  position: relative;
}

.av-pass-wrap input {
  padding-right: 60px;
}

.av-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--av-vert-clair);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
}

.av-more {
  border: 0;
  background: transparent;
  color: var(--av-vert-clair);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0 10px;
  cursor: pointer;
  display: block;
}

.av-optional {
  border-top: 1px dashed var(--av-bord);
  padding-top: 14px;
  margin-top: 4px;
}

.av-optional[hidden] {
  display: none;
}

.av-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--av-gris);
  margin: -4px 0 12px;
}

.av-btn {
  width: 100%;
  border: 0;
  border-radius: 13px;
  background: var(--av-vert);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.av-btn:hover {
  background: var(--av-vert-clair);
}

.av-btn:active {
  transform: scale(0.99);
}

.av-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.av-btn-ghost {
  background: transparent;
  color: var(--av-vert);
  border: 1.5px solid var(--av-bord);
}

.av-btn-ghost:hover {
  background: var(--av-vert-pale);
}

.av-msg {
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.av-msg[hidden] {
  display: none;
}

.av-msg.av-err {
  background: #fdecea;
  color: var(--av-rouge);
}

.av-msg.av-ok {
  background: var(--av-vert-pale);
  color: var(--av-vert);
}

.av-foot {
  text-align: center;
  color: #fff;
  opacity: 0.75;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 18px;
}

.av-foot a {
  color: #fff;
  text-decoration: underline;
}

/* Badge de compte, une fois connecté */
#av-badge {
  position: fixed;
  left: 8px;
  top: calc(58px + env(safe-area-inset-top, 0px));
  z-index: 2147482000;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--av-vert);
  color: #fff;
  font-family: "General Sans", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#av-badge:hover {
  opacity: 1;
}

#av-panel {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  background: rgba(6, 24, 14, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: "General Sans", system-ui, sans-serif;
}

#av-panel .av-sheet {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(26px + env(safe-area-inset-bottom, 0px));
  color: var(--av-texte);
}

#av-panel h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

#av-panel .av-sub {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--av-gris);
}

#av-panel dl {
  margin: 0 0 18px;
  font-size: 14px;
}

#av-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--av-bord);
}

#av-panel dt {
  color: var(--av-gris);
}

#av-panel dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.av-row {
  display: flex;
  gap: 10px;
}

.av-row .av-btn {
  flex: 1;
}

@media (min-width: 520px) {
  #av-panel {
    align-items: center;
  }
  #av-panel .av-sheet {
    border-radius: 22px;
  }
}

.av-lien-danger {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--av-rouge);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
