/* TIF Inquiry Form */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}
.hidden { display: none !important; }

.container { max-width: 520px; margin: 0 auto; padding: 16px; }

.page-header { text-align: center; padding: 24px 0 8px; }
.page-header h1 { font-size: 1.6rem; color: #7b1fa2; font-weight: 700; }

/* Steps */
.steps { display: flex; justify-content: center; gap: 4px; margin: 16px 0 20px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; max-width: 80px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: #ddd; color: #999;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; transition: all 0.3s;
}
.step-label { font-size: 0.7rem; color: #999; }
.step.active .step-num { background: #7b1fa2; color: #fff; }
.step.active .step-label { color: #7b1fa2; font-weight: 600; }
.step.done .step-num { background: #4caf50; color: #fff; }
.step.done .step-label { color: #4caf50; }

/* Panel */
.panel { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 16px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 16px; color: #333; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.req { color: #e53935; }
.form-group input, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: #7b1fa2; box-shadow: 0 0 0 2px rgba(123,31,162,0.15);
}
.hint { color: #888; font-size: 0.75rem; display: block; margin-top: 4px; }
.field-error { color: #e53935; font-size: 0.75rem; display: block; margin-top: 4px; }
.input-error { border-color: #e53935 !important; }

/* File Upload */
.file-upload-area {
  border: 2px dashed #ddd; border-radius: 8px; padding: 24px;
  text-align: center; cursor: pointer; transition: all 0.2s;
  color: #888;
}
.file-upload-area:hover { border-color: #7b1fa2; background: #faf5fc; }
.file-upload-area.dragover { border-color: #7b1fa2; background: #f3e5f5; }
.file-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.file-upload-text { font-size: 0.9rem; }
.file-upload-hint { font-size: 0.75rem; color: #aaa; margin-top: 4px; }

.file-list { margin-top: 12px; }
.file-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #fafafa; border-radius: 6px; margin-bottom: 6px;
  font-size: 0.85rem;
}
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: #888; font-size: 0.78rem; flex-shrink: 0; }
.file-item-remove {
  background: none; border: none; color: #e53935; cursor: pointer;
  font-size: 1.1rem; padding: 0 4px; flex-shrink: 0;
}
.file-item-remove:hover { color: #c62828; }

/* Preview */
.file-preview {
  width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
}
.file-preview-placeholder {
  width: 40px; height: 40px; border-radius: 4px; background: #e0e0e0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; color: #999; flex-shrink: 0;
}

/* Upload Progress */
.upload-progress { margin-top: 12px; }
.progress-item { margin-bottom: 8px; }
.progress-label { font-size: 0.82rem; margin-bottom: 2px; display: flex; justify-content: space-between; }
.progress-bar-bg { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: #7b1fa2; border-radius: 3px; transition: width 0.2s; }
.progress-bar.done { background: #4caf50; }
.progress-bar.error { background: #e53935; }

/* Confirm Table */
.confirm-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.confirm-table th, .confirm-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 0.9rem; }
.confirm-table th { width: 110px; color: #888; font-weight: 500; }
.confirm-files { font-size: 0.85rem; color: #666; }

/* Buttons */
.nav-buttons { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  padding: 12px 24px; border: none; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.btn-back { background: #eee; color: #666; flex: 0 0 auto; white-space: nowrap; }
.btn-back:hover { background: #ddd; }
.btn-next { background: #7b1fa2; color: #fff; flex: 1; }
.btn-next:hover { background: #6a1b9a; }
.btn-submit { background: #4caf50; color: #fff; flex: 1; }
.btn-submit:hover { background: #43a047; }
.btn-submit:disabled { background: #ccc; cursor: default; }

/* Done */
.done-msg { text-align: center; color: #666; font-size: 0.9rem; line-height: 1.8; margin-bottom: 16px; }
.done-check { font-size: 3rem; text-align: center; margin-bottom: 12px; color: #4caf50; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 12px 24px; border-radius: 8px;
  font-size: 0.9rem; z-index: 9999; transition: opacity 0.3s;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast-error { background: #e53935; }

/* Privacy */
.privacy-note {
  font-size: 0.78rem; color: #999; text-align: center; margin-top: 12px; line-height: 1.6;
}
.privacy-note a { color: #7b1fa2; text-decoration: none; }
.privacy-note a:hover { text-decoration: underline; }

@media (max-width: 400px) {
  .container { padding: 8px; }
  .panel { padding: 16px; }
  .confirm-table th { width: 80px; }
}
