/* Base Button */
.fsa-open {
  padding: 10px 18px;
  border: none;
  background: #0b5cff;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}
.fsa-open:hover { background: #0046d5; }

/* Modal Display Logic */
.fsa-modal { display: none; }
.fsa-modal.is-open { display: block; }

.fsa-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9998;
  backdrop-filter: blur(2px);
}

.fsa-modal__dialog {
  position: fixed;
  z-index: 9999;
  top: 50%;
  left: 50%;
  width: min(500px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  direction: rtl;
  text-align: right;
  font-family: inherit;
  max-height: 90vh;
  overflow-y: auto;
}

.fsa-modal__close {
  position: absolute;
  top: 15px;
  left: 15px;
  border: 0;
  background: #f0f0f0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.fsa-title { 
  margin: 0 0 20px; 
  font-size: 19px; 
  font-weight: bold; 
  color: #333;
  text-align: center;
}

/* Progress Bar */
.fsa-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  position: relative;
  padding: 0 10px;
}
.fsa-progress::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: #eee;
  z-index: 1;
}
.fsa-progress__item {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}
.fsa-progress__item span {
  width: 32px;
  height: 32px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 5px;
  font-weight: bold;
  color: #999;
  transition: all 0.3s;
}
.fsa-progress__item small { color: #999; font-size: 11px; }

.fsa-progress__item.is-active span { border-color: #0b5cff; color: #0b5cff; transform: scale(1.1); }
.fsa-progress__item.is-active small { color: #0b5cff; font-weight: bold; }

.fsa-progress__item.is-done span { background: #0b5cff; border-color: #0b5cff; color: #fff; }
.fsa-progress__item.is-done span::after { content: '✓'; }
.fsa-progress__item.is-done span { font-size: 0; } /* Hide number when done */

/* Form Elements */
.fsa-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin: 8px 0 16px;
  outline: none;
  font-size: 15px;
  transition: border-color 0.2s;
}
.fsa-input:focus { border-color: #0b5cff; }

.fsa-btn {
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}
.fsa-btn--primary { background: #0b5cff; border-color: #0b5cff; color: #fff; width: 100%; margin-bottom: 10px; }
.fsa-btn--primary:hover { background: #0046d5; }

.fsa-btn--ghost { background: #fff; color: #666; width: 100%; }
.fsa-btn--ghost:hover { background: #f9f9f9; }

/* Messages */
.fsa-msg {
  margin-top: 15px;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  display: none;
}
.fsa-msg:not(:empty) { display: block; }
.fsa-msg.ok { background: #e6f4ea; color: #137333; }
.fsa-msg.err { background: #fce8e6; color: #b00020; }

/* Results Section */
.fsa-post-verify {
  margin-top: 20px;
  border-top: 2px dashed #eee;
  padding-top: 20px;
}

.fsa-summary-card {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 15px;
}
.fsa-summary-card.is-success { background: #f0f9eb; border: 1px solid #c2e7b0; color: #67c23a; }
.fsa-summary-card.is-error { background: #fef0f0; border: 1px solid #fbc4c4; color: #f56c6c; }

.fsa-summary-card__title { font-weight: bold; margin-bottom: 4px; }
.fsa-summary-card__message { font-size: 13px; }

.fsa-result-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
}
.fsa-result-card__title { font-weight: bold; color: #333; margin-bottom: 8px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.fsa-result-card__message { font-size: 14px; color: #666; }

.fsa-result-card__json {
  direction: ltr;
  text-align: left;
  background: #272822;
  color: #f8f8f2;
  padding: 10px;
  border-radius: 6px;
  font-size: 11px;
  overflow-x: auto;
  margin-top: 10px;
  max-height: 150px;
}

/* Utility */
.fsa-step { transition: all 0.3s; }
