/* ============================================================
   審査通過シミュレーター — approval-simulation.css
   ============================================================ */

.as-wrapper {
  --as-color-primary:  #3b82f6;
  --as-color-success:  #16a34a;
  --as-color-danger:   #dc2626;
  --as-color-gray:     #94a3b8;
  --as-color-border:   #e2e8f0;
  --as-color-bg:       #f8fafc;
  --as-radius-card:    12px;
  --as-radius-input:   8px;
  box-sizing: border-box;
  font-family: inherit;
}

.as-wrapper *,
.as-wrapper *::before,
.as-wrapper *::after {
  box-sizing: inherit;
}

/* ─── イントロ ──────────────────────────────────────────────── */

.as-intro {
  margin-bottom: 2rem;
}

.as-intro__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 .5rem;
  line-height: 1.3;
}

.as-intro__desc {
  font-size: .875rem;
  color: #64748b;
  margin: 0;
  line-height: 1.7;
}

/* ─── レイアウト ────────────────────────────────────────────── */

.as-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .as-layout {
    grid-template-columns: 1fr 1fr;
  }
  .as-layout--result-only {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin: 0;
  }
}

.as-form-panel--hidden {
  display: none;
}

/* ─── フォームカード ─────────────────────────────────────────── */

.as-form-card {
  background: #fff;
  border: 1px solid var(--as-color-border);
  border-radius: var(--as-radius-card);
  padding: 1.5rem;
  position: relative;
}

/* ─── 条件を変更バー ──────────────────────────────────────────── */

.as-toggle-bar {
  margin-bottom: .75rem;
}

.as-btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .85rem;
  border: 1px solid var(--as-color-border);
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}

.as-btn-toggle:hover {
  background: var(--as-color-bg);
}

/* ─── フォームカード内の閉じるボタン ────────────────────────── */

.as-btn-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--as-color-border);
  border-radius: 6px;
  color: var(--as-color-gray);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
}

.as-btn-close:hover {
  background: var(--as-color-bg);
}

/* ─── フォーム ──────────────────────────────────────────────── */

.as-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.as-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.as-field-helper {
  margin: -.25rem 0 0;
  font-size: .78rem;
  color: var(--as-color-gray);
}

.as-label {
  font-size: .75rem;
  color: #64748b;
}

.as-select,
.as-input {
  width: 100%;
  padding: .55rem .8rem;
  border: 1px solid var(--as-color-border);
  border-radius: var(--as-radius-input);
  font-size: .8rem;
  background-color: #fff;
  color: #1e293b;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
}

.as-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.as-select:focus,
.as-input:focus {
  outline: none;
  border-color: var(--as-color-primary);
}

/* ─── 属性フィールド 2カラム ─────────────────────────────────── */

.as-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .875rem;
}

@media (max-width: 480px) {
  .as-fields-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── readonly ─────────────────────────────────────────────── */

.as-select--readonly,
.as-input--readonly {
  background-color: var(--as-color-bg);
  color: #94a3b8;
  cursor: default;
  opacity: 1;
}

/* ─── 送信ボタン ─────────────────────────────────────────────── */

.as-form-actions {
  margin-top: .25rem;
}

.as-btn-submit {
  width: 100%;
  padding: .8rem 1rem;
  border: none;
  border-radius: var(--as-radius-input);
  background: #64748b;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background .15s;
}

.as-btn-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.as-btn-submit:not(:disabled) {
  background: #0056b3;
}

.as-btn-submit:not(:disabled):hover {
  background: #004a99;
}

/* ─── スピナー ──────────────────────────────────────────────── */

.as-spinner {
  display: inline-block;
  width: .9em;
  height: .9em;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: as-spin .6s linear infinite;
  flex-shrink: 0;
}

.as-spinner--lg {
  width: 2rem;
  height: 2rem;
  border-color: var(--as-color-border);
  border-top-color: #94a3b8;
  margin-bottom: .75rem;
}

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

/* ─── 結果パネル ─────────────────────────────────────────────── */

.as-result-panel {
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

/* ─── プレースホルダー ───────────────────────────────────────── */

.as-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #94a3b8;
  border: 1.5px dashed var(--as-color-border);
  border-radius: var(--as-radius-card);
}

.as-placeholder-icon {
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.as-placeholder p {
  margin: 0 0 .35rem;
  font-size: .9rem;
  color: #64748b;
}

.as-placeholder-sub {
  font-size: .82rem !important;
  color: #94a3b8 !important;
}

/* ─── エラー ────────────────────────────────────────────────── */

.as-error {
  margin: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--as-radius-input);
  color: var(--as-color-danger);
  font-size: .875rem;
  line-height: 1.6;
}

.as-error p { margin: 0; }

/* ─── 結果コンテンツ ─────────────────────────────────────────── */

.as-result {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.as-card--rate {
  background: #fff;
  border: 1px solid var(--as-color-border);
  border-radius: var(--as-radius-card);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.as-card-title {
  display: inline-flex;
  align-items: center;
  font-size: .82rem;
  font-weight: 600;
  color: var(--as-color-primary);
  margin-bottom: .5rem;
}

.as-pass-rate {
  font-size: 3.5rem;
  font-weight: 800;
  color: #111827;
  line-height: 1;
  margin-bottom: .75rem;
}

.as-pass-rate-unit {
  font-size: 1.75rem;
  font-weight: 800;
}

.as-group-text {
  font-size: .9rem;
  color: #1e293b;
  margin-bottom: .3rem;
}

.as-overall {
  font-size: .85rem;
  color: #64748b;
  margin-bottom: .75rem;
}

.as-overall-rate {
  color: var(--as-color-primary);
  font-weight: 700;
}

.as-note {
  font-size: .72rem;
  color: #94a3b8;
  padding-top: .75rem;
  border-top: 1px solid var(--as-color-border);
  line-height: 1.6;
}

/* ─── 警告 ──────────────────────────────────────────────────── */

.as-warnings {
  padding: .9rem 1.1rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--as-radius-input);
  font-size: .875rem;
}

.as-warnings-title {
  color: #92400e;
  margin-bottom: .5rem;
}

.as-warnings-list {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  color: #92400e;
  line-height: 1.8;
}


.as-warnings-list li + li { margin-top: .25rem; }

/* ─── 詳細ボタン ─────────────────────────────────────────────── */

.as-btn-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .875rem 1.5rem;
  border: 1.5px solid var(--as-color-primary);
  border-radius: var(--as-radius-input);
  background: #fff;
  color: var(--as-color-primary) !important;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .15s;
  box-sizing: border-box;
}

.as-btn-detail:hover {
  background: #eff6ff;
}

/* ─── 項目別の影響（参照用に残す） ──────────────────────────── */

.as-multipliers-title {
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 .75rem;
  color: #334155;
}

.as-multipliers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

@media (max-width: 480px) {
  .as-multipliers-grid { grid-template-columns: 1fr; }
}

.as-multiplier-card {
  background: #fff;
  border: 1px solid var(--as-color-border);
  border-radius: var(--as-radius-input);
  padding: .9rem 1rem;
}

.as-multiplier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .35rem;
}

.as-multiplier-label {
  font-size: .78rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.as-multiplier-status {
  font-size: .72rem;
  font-weight: 600;
  text-align: right;
  line-height: 1.3;
}

.as-status--neutral { color: #94a3b8; }
.as-status--good    { color: var(--as-color-success); }
.as-status--bad     { color: var(--as-color-danger); }

.as-multiplier-value {
  font-size: .82rem;
  color: #475569;
  margin-bottom: .5rem;
}

.as-multiplier-divider {
  border: none;
  border-top: 1px solid var(--as-color-border);
  margin: 0 0 .5rem;
}

.as-multiplier-stats { display: flex; flex-direction: column; gap: .2rem; }

.as-multiplier-stat {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
}

.as-multiplier-stat-label { color: #94a3b8; }
.as-multiplier-stat-value { font-weight: 600; color: #475569; }

/* ─── コンボボックス ─────────────────────────────────────────── */

.as-combobox { position: relative; }

.as-combobox__dropdown {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 2px 0 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--as-color-border);
  border-radius: var(--as-radius-input);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}

.as-combobox__dropdown.is-open {
  display: block !important;
}

.as-combobox__item {
  padding: .5rem .9rem;
  font-size: .875rem;
  cursor: pointer;
  color: #1e293b;
}

.as-combobox__item:hover { background: var(--as-color-bg); }
