/**
 * 齋藤クレーン LIFF - スタイル
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 100px;
}

/* ヘッダー */
.header {
  margin-bottom: 20px;
}

.header h1 {
  font-size: 1.25rem;
  color: #333;
}

.header .user-name {
  font-size: 0.875rem;
  color: #666;
  margin-top: 4px;
}

/* 写真エリア */
.photo-area {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  border: 2px dashed #ccc;
  cursor: pointer;
  transition: border-color 0.2s;
}

.photo-area:hover {
  border-color: #4CAF50;
}

.photo-area.has-photo {
  border-style: solid;
  border-color: #4CAF50;
  padding: 8px;
}

.photo-area .photo-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.photo-area .photo-text {
  font-size: 1rem;
  color: #666;
}

.photo-area .photo-hint {
  font-size: 0.75rem;
  color: #999;
  margin-top: 4px;
}

.photo-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
}

.photo-actions {
  margin-top: 8px;
}

.btn-retake {
  background: none;
  border: none;
  color: #666;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
}

/* 非表示のファイル入力 */
.hidden-input {
  display: none;
}

/* フォームエリア */
.form-area {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.form-label .required {
  color: #c62828;
  margin-left: 4px;
}

.form-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #4CAF50;
}

.form-input::placeholder {
  color: #999;
}

.form-select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.form-select:focus {
  border-color: #4CAF50;
}

/* 折りたたみエリア */
.collapsible-header {
  display: flex;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
  color: #666;
  font-size: 0.875rem;
}

.collapsible-header .arrow {
  margin-right: 8px;
  transition: transform 0.2s;
}

.collapsible-header.open .arrow {
  transform: rotate(90deg);
}

.collapsible-content {
  display: none;
  padding-top: 8px;
}

.collapsible-content.open {
  display: block;
}

/* クレーン番号ボタン */
.crane-buttons {
  display: flex;
  gap: 8px;
}

.crane-btn {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.crane-btn:hover {
  border-color: #4CAF50;
}

.crane-btn.selected {
  background: #4CAF50;
  border-color: #4CAF50;
  color: #fff;
}

/* 送信ボタン */
.submit-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.btn-submit {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  background: #4CAF50;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-submit:hover:not(:disabled) {
  background: #43A047;
}

.btn-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-submit.loading {
  position: relative;
  color: transparent;
}

.btn-submit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 完了画面 */
.success-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.success-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #4CAF50;
  margin-bottom: 24px;
}

.btn-continue {
  padding: 12px 32px;
  font-size: 1rem;
  color: #4CAF50;
  background: #fff;
  border: 2px solid #4CAF50;
  border-radius: 8px;
  cursor: pointer;
}

/* ローディング */
.loading-screen {
  text-align: center;
  padding: 48px 16px;
  color: #666;
}

/* エラー */
.error-screen {
  background-color: #ffebee;
  color: #c62828;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.error-screen .error-message {
  margin-bottom: 16px;
}

.btn-retry {
  padding: 8px 24px;
  font-size: 0.875rem;
  color: #c62828;
  background: #fff;
  border: 1px solid #c62828;
  border-radius: 8px;
  cursor: pointer;
}
