*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

header {
  margin-bottom: 2rem;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 0.5rem;
  color: #6e6e73;
  font-size: 0.95rem;
}

/* フォームカード */
.form-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #1d1d1f;
}

.field textarea,
.field select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #d2d2d7;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1d1d1f;
  background: #fff;
  transition: border-color 0.2s;
  resize: vertical;
}

.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: #0071e3;
}

/* 生成ボタン */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem;
  background: #0071e3;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: #005bbf;
}

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

/* スピナー */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* 結果セクション */
.result-section {
  margin-top: 1.5rem;
}

.error-box {
  background: #fff5f5;
  border: 1.5px solid #ffcccc;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  color: #c0392b;
}

.error-box strong {
  display: block;
  margin-bottom: 0.25rem;
}

.success-box {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.result-meta {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.result-meta span {
  background: #f5f5f7;
  border-radius: 6px;
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6e6e73;
}

.image-wrapper {
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f7;
}

.image-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

.image-path {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #8e8e93;
  word-break: break-all;
}

/* ログインフォーム入力 */
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #d2d2d7;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1d1d1f;
  background: #fff;
  transition: border-color 0.2s;
}

.field input[type="email"]:focus,
.field input[type="password"]:focus {
  outline: none;
  border-color: #0071e3;
}

/* ログアウトボタン */
.btn-logout {
  margin-top: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: transparent;
  color: #6e6e73;
  border: 1.5px solid #d2d2d7;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-logout:hover {
  border-color: #8e8e93;
  color: #1d1d1f;
}

.hidden {
  display: none !important;
}
