/* Pure CSS styling untuk form dengan warna biru dan layout 2 grid */

:root {
  --blue-primary: #1168ef;
  --blue-secondary: #0a3c89;
  --text-primary: #000;
  --text-secondary: #666;
  --border-color: #ddd;
  --bg-white: #fff;
  --bg-light: #f9f9f9;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cartegrise-form-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.cartegrise-form {
  background-color: var(--bg-white);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 900px;
  width: 100%;
}

.form-container {
  display: block;
}

.personal-form,
.verification-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Header */
.form-header {
  margin-bottom: 16px;
}

.form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
/* Grid layout 2 kolom di desktop, 1 kolom di mobile */
.form-grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .form-grid-container {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid-container .demarche-radios {
    grid-column: 1 / -1;
  }
}
/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s ease;
}

.form-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Input styling dengan border biru */
.form-input,
.form-textarea {
  padding: 10px 16px;
  border: 1px solid var(--border-color) !important;
  border-radius: 24px !important;
  font-size: 16px;
  color: var(--text-primary);
  background-color: var(--bg-white);
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--blue-primary) !important;
  box-shadow: 0 0 0 3px rgba(17, 104, 239, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #d3d4d4;
}

.form-textarea {
  border-radius: 16px;
  resize: vertical;
  min-height: 84px;
}

/* Radio button styling */
.radio-group {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  border-radius: 24px;
  background-color: var(--bg-white);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.radio-label input[type="radio"]{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-custom {
  display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom {
  display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  display: none;
}

.radio-label input[type="radio"]:checked {
  display: none;
}

.radio-label:has(input[type="radio"]:checked) {
  border-color: var(--blue-primary);
  background-color: var(--blue-primary);
  color: var(--bg-white);
}

.radio-label:hover {
  border-color: var(--blue-primary);
  background-color: rgba(17, 104, 239, 0.1);
}

.radio-label:has(input[type="radio"]:checked):hover {
  background-color: var(--blue-primary);
  color: var(--bg-white);
}

/* Form Section */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title.underline {
  text-decoration: underline;
}

/* Checkbox styling */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-white);
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  border-color: var(--blue-primary);
  background-color: var(--blue-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✓";
  color: var(--bg-white);
  font-size: 14px;
  font-weight: bold;
}

.checkbox-label:hover .checkbox-custom {
  border-color: var(--blue-primary);
}

.checkbox-text {
  display: block;
  line-height: 1.5;
}

.cgv-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cgv-text span {
  display: block;
  line-height: 1.5;
}

/* Total */
.form-total {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 32px;
  margin-bottom: 16px;
}

.total-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-primary);
}

/* Buttons */
.form-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 16px;
}

.form-buttons-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  align-items: center;
  padding-top: 16px;
}

@media (min-width: 768px) {
  .form-buttons-group {
    flex-direction: row;
  }
}

.btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: fit-content;
}

.btn-primary {
  background-color: var(--blue-primary);
  color: var(--bg-white);
}

.btn-primary:hover {
  background-color: var(--blue-secondary);
  transform: scale(1.05);
}

.btn-secondary {
  background-color: #d3d4d4;
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: #bbb;
}

/* Verification Form */
.verification-form {
  gap: 24px;
}

.recap-content {
  padding: 20px;
  background-color: var(--bg-light);
  border-radius: 12px;
  min-height: 200px;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.payment-secure-img {
  width: 25%;
  margin: 0 auto;
  height: auto;
  margin-top: 16px;
}

/* Responsive */
@media (max-width: 640px) {
  .cartegrise-form {
    padding: 20px;
    border-radius: 16px;
  }
  .recap-content {
    padding: 10px;
  }
  .form-title {
    font-size: 18px;
  }

  .form-label {
    font-size: 14px;
  }

  .form-input,
  .form-textarea {
    font-size: 16px;
    padding: 8px 12px;
  }

  .btn {
    padding: 8px 16px;

  }
}



/* Loading/Empty State */
.loading-text {
  text-align: center;
  padding: 40px 20px;
  color: #999999;
  font-size: 14px;
  background-color: #f9f9f9;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  #recap {
    margin: 5px;
    max-width: calc(100% - 32px);
  }

  .recap-section {
    margin-bottom: 16px;
  }

  .recap-section-header {
    padding: 12px 16px;
    font-size: 15px;
  }

  .recap-section-content {
    padding: 12px 14px;
  }

  .recap-field {
    flex-direction: column;
    padding: 7px 0;
    gap: 4px;
  }

  .recap-field-label {
    min-width: auto;
    font-size: 14px;
  }

  .recap-field-value {
    text-align: left;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  #recap {
    margin: 12px;
    max-width: calc(100% - 24px);
  }

  .recap-section-header {
    padding: 10px 12px;
    font-size: 14px;
  }

  .recap-section-content {
    padding: 10px 12px;
  }

  .recap-field {
    padding: 8px 0;
  }

  .recap-field-label,
  .recap-field-value {
    font-size: 12px;
  }
}

.ff-toast-wrap {
  position: fixed;
  z-index: 99999;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 92vw;
}
.ff-toast {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.35;
}
.ff-toast.success {
  background: #0e7a2f;
}
.ff-toast.error {
  background: #a11b1b;
}
.ff-toast.info {
  background: #1b4fa1;
}
.ff-toast .ff-title {
  font-weight: 700;
  margin-right: 0.4rem;
}
.ff-toast .ff-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.ff-toast .ff-meta {
  opacity: 0.85;
  font-size: 0.92em;
}
.ff-toast.fade-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s;
}

.ff-field-error {
  color: #a11b1b;
  font-size: 0.85em;
  margin-top: 6px;
}

.form-grid-container > #tarif-inline {
  grid-column: 1 / -1;
  align-self: start;      
}


@media (min-width: 768px) {
  .form-grid-container > #tarif-inline {
    grid-column: 1 / 2;   
    grid-row: span 2;     
  }


  .form-grid-container .demarche-radios {
    grid-column: 1 / -1;
  }
}

/* === Radio circle bleu (classes dédiées) === */

.radio-circle-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-circle-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* cacher le vrai input */
.radio-circle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* cercle "classique" */
.radio-circle-custom {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #1a73e8;       /* bleu principal */
    margin-right: 10px;
    margin-top: 3px;
    position: relative;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* point bleu à l'intérieur */
.radio-circle-custom::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #1a73e8;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease-in-out;
}

/* état checked */
.radio-circle-input:checked + .radio-circle-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

/* hover */
.radio-circle-label:hover .radio-circle-custom {
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
    border-color: #1a73e8;
}

.radio-circle-text {
    flex: 1;
}

/* état erreur */
.radio-circle-group.error .radio-circle-label {
    color: #dc3545;
}

.radio-circle-group.error .radio-circle-custom {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.radio-circle-group.error::after {
    content: "Veuillez sélectionner une option";
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #dc3545;
}
