/* ============================================================
 * メール配信診断ツール — メインスタイルシート
 * Laravel public/css/app.css
 * ============================================================ */

/* --- リセット & ベース ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --primary-light: #e0e7ff;
  --success:  #10b981;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --bg:       #f8fafc;
  --surface:  #ffffff;
  --border:   #e2e8f0;
  --text:     #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius:   12px;
  --shadow:   0 4px 24px rgba(0,0,0,.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); }
img { max-width: 100%; }

/* --- サイトヘッダー ------------------------------------------ */
.site-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
}
.site-logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
}

/* --- メインコンテンツ ----------------------------------------- */
.site-main {
  min-height: calc(100vh - 120px);
  padding-bottom: 3rem;
}
.diag-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* --- フッター ------------------------------------------------- */
.site-footer {
  background: #1e293b;
  color: var(--text-light);
  text-align: center;
  padding: 1.25rem;
  font-size: .85rem;
}

/* --- カード --------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.card h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }
.card p  { color: var(--text-muted); margin-bottom: 1rem; }

/* --- ボタン --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
  line-height: 1;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; }

/* --- フォーム ------------------------------------------------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; color: var(--text); margin-bottom: .4rem; }
.form-control {
  width: 100%;
  padding: .65rem .875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.form-hint { display: block; font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }

/* --- アラート ------------------------------------------------- */
.alert {
  border-radius: 8px;
  padding: .875rem 1.125rem;
  font-size: .9rem;
  margin-bottom: 1rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* --- ヒーロー ------------------------------------------------- */
.hero-section { text-align: center; padding: 2.5rem 1rem 2rem; }
.hero-icon { font-size: 3.5rem; margin-bottom: .75rem; }
.hero-section h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .5rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-section p { color: var(--text-muted); font-size: 1.05rem; }

/* --- メールアドレス表示 --------------------------------------- */
.email-display {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
  word-break: break-all;
  flex-wrap: wrap;
}
.email-display button { background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: .25rem; flex-shrink: 0; }

/* --- ステータスバッジ ----------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
}
.badge-ok      { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-fail    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-na      { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* --- 診断項目カード ------------------------------------------- */
.item-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.item-card.status-ok           { border-left-color: var(--success); }
.item-card.status-warning      { border-left-color: var(--warning); }
.item-card.status-fail         { border-left-color: var(--danger); }
.item-card.status-not_available{ border-left-color: var(--text-light); }
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.item-title  { font-weight: 600; }
.item-score  { font-size: .85rem; color: var(--text-muted); margin-bottom: .375rem; }
.item-reason { font-size: .9rem; color: #475569; margin: 0; }
.item-recommendation {
  margin-top: .75rem;
  padding: .75rem;
  background: #f8fafc;
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text);
}

/* --- 改善ポイント --------------------------------------------- */
.improvement-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .75rem 1rem;
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: .5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  font-size: .9rem;
}

/* --- スコアサークル ------------------------------------------- */
.score-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.score-circle { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-num   { font-size: 2rem; font-weight: 700; line-height: 1; }
.score-denom { font-size: .8rem; color: var(--text-muted); }
.score-label { font-size: 1.3rem; font-weight: 600; margin-bottom: .25rem; }
.score-ip, .score-domain { font-size: .9rem; color: var(--text-muted); }

/* --- スピナー ------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 1em; height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: .3rem;
}

/* --- レスポンシブ --------------------------------------------- */
@media (max-width: 640px) {
  .hero-section h1 { font-size: 1.5rem; }
  .score-card { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .item-header { flex-direction: column; align-items: flex-start; }
  .btn-lg { width: 100%; justify-content: center; }
  .diag-container { padding: 1.25rem .75rem; }
}
