/**
 * S3 日報入力フォーム (サブ画面)
 * Phase 2-B-1.1 改修:
 *   - 日時入力 (date + time HH:MM 2セレクト) レイアウト
 *   - 詳細フィールド: アポ/見積, 活動内容, エリア, 面会者, 所感 (s3-field-detail)
 *   - 保存バー: 2ボタン (日報を保存 / 保存してタスクを作る)
 */

/* モード切替 (セグメンテッドコントロール) */
.s3-mode-bar {
  display: flex;
  background: var(--mobile-bg);
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  padding: 3px;
  margin: 16px 16px 0;
}

.s3-mode-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--mobile-text-secondary);
  border-radius: 6px;
  cursor: pointer;
}

.s3-mode-btn.is-active {
  background: var(--mobile-surface);
  color: var(--mobile-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* フォーム */
.s3-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
}

.s3-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 詳細モードでのみ表示するフィールド */
.s3-field-detail {
  display: none;
}

.s3-form.is-detail .s3-field-detail {
  display: flex;
}

.s3-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mobile-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.s3-required {
  color: #e24b4a;
  font-size: 12px;
}

.s3-optional {
  font-size: 11px;
  color: var(--mobile-text-tertiary);
  font-weight: 400;
  margin-left: 4px;
}

.s3-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--mobile-surface);
  color: var(--mobile-text);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.s3-input:focus {
  outline: none;
  border-color: var(--mobile-accent);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}

.s3-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--mobile-surface);
  color: var(--mobile-text);
  box-sizing: border-box;
  min-height: 80px;
  resize: vertical;
}

.s3-textarea-large {
  min-height: 120px;
}

.s3-textarea:focus {
  outline: none;
  border-color: var(--mobile-accent);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}

/* ============================================================
   日時入力行 (date + time)
   ============================================================ */

.s3-datetime-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.s3-input-date {
  flex: 1 1 140px;
  min-width: 130px;
}

.s3-time-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
}

.s3-input-time {
  flex: 0 0 auto;
  width: auto;
  min-width: 64px;
  padding: 12px 8px;
  background-image: none;
  text-align: center;
  text-align-last: center;
}

.s3-time-sep {
  font-size: 13px;
  color: var(--mobile-text-secondary);
  flex: 0 0 auto;
}

/* type セグメンテッドコントロール */
.s3-type-bar {
  display: flex;
  background: var(--mobile-bg);
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  padding: 3px;
}

.s3-type-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--mobile-text-secondary);
  border-radius: 6px;
  cursor: pointer;
}

.s3-type-btn.is-active {
  background: var(--mobile-accent);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* チェックボックス2つ並び (アポ/見積) */
.s3-flags {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s3-flag {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.s3-flag.is-checked {
  background: var(--mobile-accent-light);
  border-color: var(--mobile-accent);
}

.s3-flag input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--mobile-accent);
  flex: 0 0 auto;
}

.s3-flag-text {
  flex: 1;
}

.s3-flag-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--mobile-text);
}

.s3-flag-desc {
  font-size: 11px;
  color: var(--mobile-text-tertiary);
  margin-top: 1px;
}

.s3-flag.is-checked .s3-flag-title {
  color: var(--mobile-accent-dark);
  font-weight: 600;
}

/* type が「見積提出のみ」の時はアポ獲得を無効化 */
.s3-flag.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.s3-error {
  background: #FCEBEB;
  border: 1px solid #F09595;
  color: #791F1F;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 16px 16px 0;
}

/* ============================================================
   保存バー (2ボタン)
   ============================================================ */

.s3-submit-bar {
  position: sticky;
  bottom: 0;
  background: var(--mobile-surface);
  border-top: 1px solid var(--mobile-border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
}

.s3-btn-submit {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 13px 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.s3-btn-submit:disabled {
  background: #c8c7c0;
  color: white;
  cursor: not-allowed;
}

.s3-btn-submit-primary {
  background: var(--mobile-accent);
  color: white;
}

.s3-btn-submit-primary:active {
  background: var(--mobile-accent-dark);
}

.s3-btn-submit-secondary {
  background: var(--mobile-surface);
  color: var(--mobile-accent-dark);
  border: 1.5px solid var(--mobile-accent);
}

.s3-btn-submit-secondary:active {
  background: var(--mobile-accent-light);
}

.s3-btn-submit-secondary:disabled {
  background: var(--mobile-surface);
  color: #c8c7c0;
  border-color: #c8c7c0;
}
/* ============================================================
   Phase 2-B-3.3: 編集モード (読み取り専用フィールド)
   (このブロックを mobile-s3-create.css の末尾に追記)
   ============================================================ */

.s3-readonly {
  padding: 11px 14px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 15px;
  line-height: 1.4;
}

.s3-input-date:disabled {
  background: #f1f5f9;
  color: #64748b;
  opacity: 1;
  -webkit-text-fill-color: #64748b;
}

.s3-field-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
}

