/* Pages app : inscription, admin, mes-formations */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");

:root {
  --bg-cream: #f7efe7;
  --text: #111;
  --muted: #555;
  --accent: #ff7a1a;
  --blue: #0b4b77;
  --white: #fff;
  --border: #e2e8f0;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.doc-current {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.doc-current-name {
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-current .doc-download-link {
  font-size: 0.85rem;
  color: var(--blue);
  text-decoration: underline;
}

.doc-current .doc-remove-btn {
  padding: 4px 10px;
  font-size: 0.8rem;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-wrap {
  margin: auto;
  padding: 24px 10em;
  flex: 1 1 auto;
}

.app-header {
  text-align: center;
  margin-bottom: 32px;
}

.app-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px 0;
}

.app-header-subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.app-header-note {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

.required-indicator {
  color: var(--accent);
  font-weight: 700;
  margin-left: 2px;
}

.app-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 32px;
  margin-bottom: 24px;
}

/* Bloc accès refusé (lien invalide / token expiré) */
.app-card--forbidden {
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.04);
}

.forbidden-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--danger);
  margin: 0 0 12px 0;
}

.forbidden-text {
  color: var(--text);
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.forbidden-actions {
  margin: 0;
}

.forbidden-actions .link-back {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
}

.forbidden-actions .link-back:hover {
  background: #093a5c;
  color: var(--white);
}

/* Barre de progression */
.form-progress {
  background: var(--white);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}

.form-progress-bar {
  position: relative;
}

.form-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress-width, 0%);
  background: linear-gradient(90deg, var(--accent), #ff9a4d);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.form-progress-text {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.app-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.app-form input,
.app-form select,
.app-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 18px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.app-form input:hover,
.app-form select:hover,
.app-form textarea:hover {
  border-color: rgba(11, 75, 119, 0.3);
}

.app-form input:focus,
.app-form select:focus,
.app-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}

.app-form input:invalid:not(:placeholder-shown),
.app-form select:invalid:not(:placeholder-shown),
.app-form textarea:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

.app-form input:valid:not(:placeholder-shown):not([type="file"]),
.app-form select:valid:not(:placeholder-shown),
.app-form textarea:valid:not(:placeholder-shown) {
  border-color: var(--success);
}

.app-form textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.app-form select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  appearance: none;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.app-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-btn-primary {
  background: var(--accent);
  color: var(--white);
}

.app-btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 122, 26, 0.3);
}

.app-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-loader.hidden {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-text {
  display: inline-block;
}

.btn-text.hidden {
  display: none;
}

.app-btn:disabled .btn-text {
  opacity: 0.7;
}

.app-btn-secondary {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}

.app-btn-danger {
  background: var(--danger);
  color: var(--white);
}

.app-btn-success {
  background: var(--success);
  color: var(--white);
}

.app-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.app-message.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.app-message.success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.app-message.info {
  background: #eff6ff;
  color: var(--blue);
  border: 1px solid #bfdbfe;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
}

.app-table th,
.app-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.app-table th {
  font-weight: 600;
  color: var(--blue);
  background: rgba(11, 75, 119, 0.06);
}

.app-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-pending {
  background: #fef3c7;
  color: var(--warning);
}

.badge-validated {
  background: #d1fae5;
  color: var(--success);
}

.badge-rejected {
  background: #fee2e2;
  color: var(--danger);
}

@media (max-width: 640px) {
  .app-table th:nth-child(n+3),
  .app-table td:nth-child(n+3) {
    display: none;
  }
  .app-table th:nth-child(1):after { content: " Nom"; }
  .app-table th:nth-child(2):after { content: " Email"; }
}

.link-back-wrapper {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
}

.link-back {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  padding: 8px 12px;
  border-radius: 6px;
}

.link-back:hover {
  text-decoration: underline;
  background: rgba(11, 75, 119, 0.05);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.form-actions .app-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.05rem;
}

.form-actions-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  grid-template-columns: 1fr 1.5fr 1fr;
}

.form-section {
  border: none;
  margin: 0 0 36px 0;
  padding: 0;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-section-legend {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.form-section-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -8px 0 16px 0;
}

.form-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 16px;
}

.form-file {
  padding: 10px 0;
  margin-bottom: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

.form-file::-webkit-file-upload-button {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-cream);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.2s;
}

.form-file::-webkit-file-upload-button:hover {
  background: rgba(11, 75, 119, 0.05);
  border-color: var(--blue);
}

.form-file::file-selector-button {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-cream);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.2s;
}

.form-file::file-selector-button:hover {
  background: rgba(11, 75, 119, 0.05);
  border-color: var(--blue);
}

@media (max-width: 640px) {
  .app-wrap {
    padding: 16px 12px;
  }

  .app-card {
    padding: 20px 16px;
  }

  .app-header h1 {
    font-size: 1.5rem;
  }

  .form-progress {
    padding: 16px;
  }

  .section-number {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .form-section-legend {
    font-size: 1rem;
  }
}

@media (max-width: 500px) {
  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .app-form input,
  .app-form select,
  .app-form textarea {
    padding: 10px 12px;
    font-size: 16px; /* Évite le zoom sur iOS */
  }
}

/* Popup modale de succès */
.modal-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-popup.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-popup-content {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: slideUp 0.3s ease;
  z-index: 1;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-popup-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: scaleIn 0.3s ease 0.1s both;
}

.modal-popup-icon--success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: var(--success);
}

.modal-popup-icon--warning {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.modal-popup-icon svg {
  width: 48px;
  height: 48px;
}

.modal-popup-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px 0;
}

.modal-popup-message {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.modal-popup-close {
  min-width: 160px;
}

@media (max-width: 640px) {
  .modal-popup-content {
    padding: 32px 24px;
    margin: 0 12px;
  }

  .modal-popup-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
  }

  .modal-popup-icon svg {
    width: 40px;
    height: 40px;
  }

  .modal-popup-title {
    font-size: 1.25rem;
  }

  .modal-popup-message {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }
}

/* Footer commun (mentions, année, Rizon Works) */
.app-footer {
  margin-top: auto;
  padding: 20px 16px;
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.8125rem;
  text-align: center;
}
.app-footer__inner {
  max-width: 720px;
}
.app-footer__links a,
.app-footer__credit-link {
  color: #94a3b8;
  text-decoration: none;
}
.app-footer__links a:hover,
.app-footer__credit-link:hover {
  color: #fff;
  text-decoration: underline;
}
.app-footer__credit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
.app-footer__logo {
  height: 40px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Accordéons (sections repliables) */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--white);
}
.accordion-item:last-of-type {
  margin-bottom: 0;
}
.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  text-align: left;
  background: #f8fafc;
  border: none;
  cursor: pointer;
  font-family: inherit;
  list-style: none;
}
.accordion-header::-webkit-details-marker {
  display: none;
}
.accordion-header::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.accordion-item[open] .accordion-header::before {
  transform: rotate(-135deg);
}
.accordion-header .section-number {
  flex-shrink: 0;
}
.accordion-panel {
  padding: 20px 16px;
  border-top: 1px solid var(--border);
}
.accordion-panel .form-row,
.accordion-panel > div {
  margin-bottom: 16px;
}
.accordion-panel .form-row:last-child,
.accordion-panel > div:last-child {
  margin-bottom: 0;

/* Mes formations – liste */
.formation-list-item {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
}
}
