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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: 480px;
}

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

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a2e;
}

.hidden {
  display: none !important;
}

.description {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1.5rem;
}

/* フォーム */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #444;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

button {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#otp-submit,
#download-btn {
  background: #4a90d9;
  color: #fff;
  margin-top: 0.5rem;
}

#otp-submit:hover:not(:disabled),
#download-btn:hover:not(:disabled) {
  background: #357abd;
}

/* エラーメッセージ */
.error-message {
  background: #fff5f5;
  color: #c53030;
  padding: 0.625rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  border: 1px solid #feb2b2;
}

/* ファイル一覧 */
.file-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.file-actions button {
  width: auto;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  background: #e2e8f0;
  color: #4a5568;
}

.file-actions button:hover {
  background: #cbd5e0;
}

#file-list {
  list-style: none;
  margin-bottom: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: #fff;
}

.file-item input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.9375rem;
  font-weight: 500;
  word-break: break-all;
}

.file-size {
  font-size: 0.8125rem;
  color: #718096;
}

/* エラー画面 */
.error-box {
  text-align: center;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.error-box p {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.error-box a {
  color: #4a90d9;
  text-decoration: none;
}

.error-box a:hover {
  text-decoration: underline;
}

/* ダウンロード完了画面 */
.complete-box {
  text-align: center;
  padding: 2rem;
  background: #f0fff4;
  border-radius: 8px;
  border: 1px solid #c6f6d5;
}

.complete-box p {
  font-size: 1rem;
  color: #276749;
}

/* ダウンロードステータス */
#download-status {
  margin-top: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #f0fff4;
  color: #276749;
  border: 1px solid #c6f6d5;
}
