/* ── soumettre.css ── */

/* ── Page wrapper ── */
.submit-page {
  min-height: calc(100vh - 60px);
  background: var(--light);
  padding: 48px 5% 64px;
}

/* ── Auth gate (écran login) ── */
.auth-gate {
  max-width: 420px;
  margin: 60px auto 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-gate-header {
  background: var(--green);
  padding: 28px 32px 24px;
  text-align: center;
}
.auth-gate-header .lock-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}
.auth-gate-header h2 {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 4px;
}
.auth-gate-header p {
  color: rgba(255,255,255,.8);
  font-size: .85rem;
}
.auth-gate-body {
  padding: 28px 32px 32px;
}
.auth-error {
  background: #fce4ec;
  color: var(--red);
  border: 1px solid #f8bbd0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}
.auth-error.visible { display: block; }

/* ── Form général ── */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 700;
  font-size: .83rem;
  color: var(--dark);
  margin-bottom: 6px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.form-group label .required {
  color: var(--red);
  margin-left: 2px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: .93rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,165,80,.1);
}
.form-control.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(249,71,34,.1);
}
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* ── Bouton login ── */
.btn-login {
  width: 100%;
  background: var(--green);
  color: var(--white);
  border: none;
  padding: 13px;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: .93rem;
  letter-spacing: .05em;
  cursor: pointer;
  transition: background .2s, transform .15s;
  margin-top: 6px;
}
.btn-login:hover { background: var(--green-light); transform: translateY(-1px); }
.btn-login:active { transform: none; }

/* ── Formulaire de soumission ── */
.submit-container {
  max-width: 720px;
  margin: 0 auto;
  display: none;
}
.submit-container.visible { display: block; }

.submit-header {
  text-align: center;
  margin-bottom: 32px;
}
.submit-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--green);
  margin-bottom: 6px;
}
.submit-header p {
  color: var(--gray);
  font-size: .9rem;
}

/* Barre de progression */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.progress-step .step-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--border);
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  transition: background .3s, color .3s;
  z-index: 1;
}
.progress-step.active .step-circle {
  background: var(--green);
  color: white;
}
.progress-step.done .step-circle {
  background: var(--gold);
  color: white;
}
.progress-step .step-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.progress-step.active .step-label { color: var(--green); }
.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 20px;
  min-width: 40px;
  max-width: 80px;
  transition: background .3s;
}
.progress-line.done { background: var(--gold); }

/* Cards de section */
.form-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 20px;
  display: none;
}
.form-card.active { display: block; animation: fadeDown .25s ease; }
.form-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--green);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-card-title i { color: var(--gold); }

/* Grid 2 colonnes */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Upload PDF */
.pdf-upload-area {
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  position: relative;
}
.pdf-upload-area:hover { background: #f0faf5; }
.pdf-upload-area.has-file {
  background: #f0faf5;
  border-color: var(--gold);
  border-style: solid;
}
.pdf-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.pdf-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.pdf-upload-text {
  font-weight: 700;
  font-size: .88rem;
  color: var(--green);
  margin-bottom: 4px;
}
.pdf-upload-hint {
  font-size: .78rem;
  color: var(--gray);
}
.pdf-file-name {
  margin-top: 8px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--gold);
  display: none;
}
.pdf-file-name.visible { display: block; }

/* Tags mots-clés */
.tags-input-wrapper {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  cursor: text;
  transition: border-color .2s, box-shadow .2s;
  min-height: 46px;
  align-items: center;
}
.tags-input-wrapper:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,165,80,.1);
}
.tag-chip {
  background: #e8f5ee;
  color: var(--green);
  border: 1px solid rgba(0,165,80,.25);
  border-radius: 20px;
  padding: 3px 10px 3px 12px;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tag-chip button {
  background: none;
  border: none;
  color: var(--green);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  padding: 0;
  opacity: .7;
}
.tag-chip button:hover { opacity: 1; }
.tags-input {
  border: none;
  outline: none;
  font-family: 'Source Sans 3', sans-serif;
  font-size: .9rem;
  color: var(--dark);
  flex: 1;
  min-width: 120px;
  background: transparent;
}

/* Navigation entre étapes */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.btn-prev {
  background: none;
  border: 2px solid var(--border);
  color: var(--gray);
  padding: 11px 24px;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-prev:hover { border-color: var(--green); color: var(--green); }
.btn-next, .btn-submit {
  background: var(--green);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: background .2s, transform .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-next:hover, .btn-submit:hover { background: var(--green-light); transform: translateY(-1px); }
.btn-submit { background: var(--red); }
.btn-submit:hover { background: var(--red-light); }

/* User connecté */
.user-bar {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
}
.user-bar.visible { display: flex; }
.user-bar strong { color: var(--green); }
.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--gray);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); }

/* Toast succès */
.toast-success {
  display: none;
  max-width: 560px;
  margin: 60px auto 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  padding: 48px 40px;
}
.toast-success.visible { display: block; animation: fadeDown .4s ease; }
.toast-icon { font-size: 3rem; margin-bottom: 16px; }
.toast-success h2 {
  font-family: 'Playfair Display', serif;
  color: var(--green);
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.toast-success p { color: var(--gray); font-size: .9rem; line-height: 1.7; }
.toast-success a {
  display: inline-block;
  margin-top: 24px;
  background: var(--green);
  color: white;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .88rem;
  transition: background .2s;
}
.toast-success a:hover { background: var(--green-light); }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 20px 18px; }
  .auth-gate-body { padding: 22px 20px 24px; }
  .auth-gate-header { padding: 22px 20px 18px; }
  .progress-line { min-width: 20px; }
  .submit-header h1 { font-size: 1.35rem; }
}