/* ===== 基本設定と変数 ===== */
:root {
  --color-brand: #fc5200;
  --color-brand-dark: #e24a00;
  --color-bg-light: #f3f4f6;
  --color-bg-white: #ffffff;
  --color-text-dark: #222;
  --color-text-medium: #222 !important;
  --color-text-light: #ccc !important;
  --color-border: #d1d5db;
  --color-placeholder: #ccc;
}

/* ===== 調整用コード（オペレーター追加）===== */
.calculator-container {
  line-height: 1.2;
  margin-bottom: 2rem !important;
}
.calculator-container h2,
.calculator-container h3 {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
}
h2.result-title,
h2.main-title {
  color: #222;
  padding-bottom: 16px !important;
}
h3.result-box-title,
h3.advice-title {
  padding-bottom: 10px;
}
.cta-button {
  margin-bottom: 1.5rem;
}

/* ===== コンテナとフォーム ===== */
.calculator-container {
  width: 100%;
  /* max-width: 42rem; */
  margin: auto;
  background-color: var(--color-bg-white);
  border-radius: 1rem; /* rounded-2xl */
  padding: 2.5rem; /* p-10 */
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  border: 1px solid #e5e7eb;
}

.logo {
  height: 2rem; /* h-8 */
  margin: 0 auto 1.5rem auto; /* mx-auto mb-6 */
}

.main-title {
  font-size: 1.875rem; /* text-3xl */
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 2rem;
}

.input-group h2 {
  font-size: 1.125rem; /* text-lg */
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text-medium);
}

.button-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.button-group button {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-light);
  border-radius: 0.5rem;
  border: 2px solid var(--color-border);
  transition: border-color 0.2s;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text-dark);
}

.button-group button:hover {
  border-color: var(--color-brand);
}

.button-group button.selected {
  border-color: var(--color-brand);
  /* background-color: #fff7ed; */ /* ご要望に応じて背景色は変更しない */
}

.duration-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-wrapper {
  position: relative;
  flex-grow: 1;
}

.input-wrapper input {
  width: 100%;
  text-align: center;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-light);
  border-radius: 0.5rem;
  border: 2px solid var(--color-border);
  font-size: 1.125rem;
  transition: border-color 0.2s;
}

.input-wrapper input::placeholder {
  color: var(--color-placeholder);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--color-brand);
}

.input-wrapper input.has-input {
  border-color: var(--color-brand);
}

.input-wrapper span {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
}

.cta-button {
  width: 100%;
  background-color: var(--color-brand);
  color: white;
  font-size: 1.25rem; /* text-xl */
  font-weight: 700;
  padding: 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  text-align: center;
  text-decoration: none;
  display: block;
}

.cta-button:hover {
  background-color: var(--color-brand-dark);
  transform: scale(1.02);
}

.cta-button:disabled {
  background-color: #d1d5db; /* gray-300 */
  cursor: not-allowed;
  transform: scale(1);
}

.error-text {
  color: #ef4444; /* red-500 */
  text-align: center;
  margin-top: 1rem;
  /* height: 1.5rem; */
}

/* ===== 結果表示 ===== */
.hidden {
  display: none;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
}
.result-subtitle {
  text-align: center;
  color: var(--color-text-medium);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}
.result-main {
  text-align: center;
  margin-bottom: 2rem;
}
.result-main span:first-child {
  font-size: 6rem; /* text-8xl/9xl */
  font-weight: 700;
  color: var(--color-brand);
  line-height: 1em;
}
.result-main .unit {
  font-size: 2.25rem; /* text-4xl */
  font-weight: 700;
  color: var(--color-text-light);
  margin-left: 0.5rem;
}

.result-box {
  background-color: var(--color-bg-light);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e5e7eb;
}
.result-box-title {
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--color-text-medium);
}
.result-box-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  font-size: 1.125rem;
}

.result-box-content span {
  font-weight: 700;
}

.advice-box {
  /* background-color: #f9fafb;  */
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}
.advice-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-medium);
}
.advice-box ul {
  list-style-position: outside;
  list-style-type: disc;
  display: flex;
  flex-direction: column;
  /* gap: 0.5rem; */
  color: var(--color-text-medium);
}
.advice-box a {
  color: var(--color-brand);
  text-decoration: none;
}
.advice-box a:hover {
  text-decoration: underline;
}

.calorie-link-box {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem; /* text-sm */
  color: var(--color-text-light);
}
.calorie-link-box p {
  margin: 0.25rem 0;
}
.calorie-link-box a {
  color: var(--color-brand);
}

.reset-button {
  width: 100%;
  margin-top: 1.5rem;
  color: var(--color-brand);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.reset-button:hover {
  color: var(--color-brand-dark);
}

/* iOSでのフォーム入力時の自動ズームを防止 */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
textarea {
  font-size: 16px;
}
/* スティッキーヘッダーとの重なりを防止 */
#calculator-form {
  scroll-margin-top: 60px;
}
#result-section {
  scroll-margin-top: 60px;
}
/* aタグをCTAボタンとして使う際の文字色を白に強制する */
a.cta-button,
a.cta-button:visited {
  color: white !important;
  text-decoration: none !important;
}
/* 入力完了時のボーダー */
.input-completed {
  border-color: #fc5200 !important;
}
