/* ==========================================================
   SOLUTCLOUD — PROSPECTION TERRAIN
   Style conforme à la Charte Graphique v1.0 (I-SOLUTIONS.CI)
   ========================================================== */

/* ---------- 1. Variables charte ---------- */
:root {
  /* Couleurs de marque */
  --sc-teal: #2b909a; /* Texte principal / marque */
  --sc-teal-dark: #1f747d; /* Teal ombré (états survol) */
  --sc-emblem: #3e8f97; /* Emblème molécule */
  --sc-violet: #8c52ff; /* Dégradé signature — départ */
  --sc-orange: #ff914d; /* Dégradé signature — arrivée */

  /* Couleurs d'accompagnement */
  --sc-title: #1a2e35; /* Titres d'interface */
  --sc-text: #4a6269; /* Corps de texte */
  --sc-bg: #f4f9f9; /* Fond de page */
  --sc-surface: #ffffff; /* Cartes et surfaces */
  --sc-border: #d9e7e8; /* Bordures légères */

  /* Couleurs fonctionnelles */
  --sc-success: #3e8f97; /* Succès = teal emblème */
  --sc-error: #c4453f; /* Erreur (usage fonctionnel) */

  /* Typographies charte */
  --font-brand: "League Spartan", "Poppins", sans-serif;
  --font-ui: "Poppins", "Inter", sans-serif;
  --font-body: "Inter", "Poppins", sans-serif;

  /* Divers */
  --radius: 14px;
  --shadow: 0 6px 18px rgba(26, 46, 53, 0.08);
  --gradient-signature: linear-gradient(90deg, var(--sc-teal));
}

/* ---------- 2. Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--sc-bg);
  color: var(--sc-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] {
  display: none !important;
}

/* ---------- 3. Header ---------- */
.app-header {
  background: var(--sc-surface);
  border-bottom: 1px solid var(--sc-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Ligne signature (dégradé violet → orange) */
.app-header::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--gradient-signature);
}

.header-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 0.9rem 1rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.header-tag {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sc-teal);
  white-space: nowrap;
}

/* ---------- 4. Zone principale ---------- */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

/* ---------- 5. Cartes ---------- */
.card {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 1.5rem 1.25rem 1.75rem;
}

.card-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--sc-title);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--sc-text);
  margin-bottom: 1.5rem;
}

/* ---------- 6. Champs ---------- */
.field {
  margin-bottom: 1.1rem;
}

.label {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--sc-title);
  margin-bottom: 0.4rem;
}

.label .req {
  color: var(--sc-orange);
  margin-left: 2px;
}

.control {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--sc-title);
  background: var(--sc-surface);
  border: 2px solid var(--sc-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.control:focus {
  outline: none;
  border-color: var(--sc-teal);
  box-shadow: 0 0 0 4px rgba(43, 144, 154, 0.14);
}

.control::placeholder {
  color: #9ab3b6;
}

textarea.control {
  min-height: 96px;
  resize: vertical;
}

select.control {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232B909A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  padding-right: 2.6rem;
}

/* ---------- 7. Boutons ---------- */
.btn-primary {
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.02rem;
  color: #ffffff;
  background: var(--sc-teal);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.5rem;
  transition:
    background 0.15s ease,
    transform 0.05s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary:hover {
  background: var(--sc-teal-dark);
}
.btn-primary:active {
  transform: scale(0.99);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-ghost {
  width: 100%;
  margin-top: 0.9rem;
  background: transparent;
  color: var(--sc-teal);
  border: 2px solid var(--sc-teal);
  border-radius: 10px;
  padding: 0.85rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 8. Consentement ---------- */
.consent {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--sc-text);
  margin-top: 1rem;
}

.consent a {
  color: var(--sc-teal);
}

/* ---------- 9. Panneaux succès / erreur ---------- */
.panel {
  text-align: center;
  padding: 2.25rem 1.5rem;
}

.panel-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  color: #ffffff;
  background: var(--sc-success);
}

.panel-icon.error {
  background: var(--sc-error);
}

.panel-title {
  font-family: var(--font-brand);
  font-size: 1.3rem;
  color: var(--sc-title);
  margin-bottom: 0.4rem;
}

.panel-text {
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ---------- 10. Footer ---------- */
.app-footer {
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--sc-text);
}

/* ---------- 11. Responsive ---------- */
@media (max-width: 400px) {
  .card-body {
    padding: 1.25rem 1rem 1.5rem;
  }
  .header-tag {
    font-size: 0.72rem;
  }
}


/* ========== Notification haute (toast) ========== */
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-left: 4px solid var(--sc-surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .85rem 1rem;
  z-index: 100;
  animation: toastIn .35s cubic-bezier(.22, 1, .36, 1);
}
.toast.leaving { animation: toastOut .3s ease forwards; }
.toast-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sc-error);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.toast-text { flex: 1; font-size: .88rem; color: var(--sc-title); }
.toast-close {
  flex: 0 0 auto;
  border: none; background: transparent;
  font-size: 1.2rem; line-height: 1;
  color: var(--sc-text);
  cursor: pointer;
  padding: .25rem;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, -16px); }
}

/* ========== Animation de succès ========== */
#successCard { animation: cardIn .45s cubic-bezier(.22, 1, .36, 1); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.success-visual {
  position: relative;
  width: 84px; height: 84px;
  margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.success-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--sc-emblem);
  opacity: 0;
  animation: ring 1.1s .15s cubic-bezier(.22, 1, .36, 1) forwards;
}
@keyframes ring {
  0%   { opacity: .8; transform: scale(.6); }
  100% { opacity: 0; transform: scale(1.45); }
}
.success-icon {
  width: 72px; height: 72px;
  object-fit: contain;
  animation: popIn .55s .1s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.success-visual.fallback::before {
  content: "✓";
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--sc-success);
  color: #fff;
  font-size: 2.2rem;
  display: flex; align-items: center; justify-content: center;
  animation: popIn .55s .1s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1); }
}
#successCard .panel-title { animation: fadeUp .5s .25s ease backwards; }
#successCard .panel-text  { animation: fadeUp .5s .35s ease backwards; }
#successCard .btn-ghost   { animation: fadeUp .5s .45s ease backwards; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}