/* ============================================
   INTERCONTECH Forms CSS
   WordPress移行対応 - 独立クラス設計

   クラス名規則:
   - itc-form__*     : フォーム共通
   - itc-contact__*  : お問い合わせ専用
   - itc-input__*    : 入力要素
   ============================================ */

/* ============================================
   Form Container
   ============================================ */

.itc-form {
  max-width: 700px;
  margin: 0 auto;
}

.itc-form__section {
  margin-bottom: 48px;
}

.itc-form__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1a1a1a;
}

.itc-form__desc {
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  margin-bottom: 32px;
}

/* ============================================
   Form Group (Label + Input)
   ============================================ */

.itc-form__group {
  margin-bottom: 24px;
}

.itc-form__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.itc-form__label--required::after {
  content: '必須';
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  border-radius: 3px;
}

.itc-form__label--optional::after {
  content: '任意';
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #95a5a6;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  border-radius: 3px;
}

.itc-form__hint {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}

/* ============================================
   Input Elements
   ============================================ */

.itc-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.itc-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.itc-input::placeholder {
  color: #aaa;
}

.itc-input--error {
  border-color: #e74c3c;
}

.itc-input--error:focus {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Textarea */
.itc-input--textarea {
  min-height: 180px;
  resize: vertical;
}

/* Select */
.itc-input--select {
  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='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ============================================
   Radio & Checkbox
   ============================================ */

.itc-form__options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.itc-form__option {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.itc-form__option input[type="radio"],
.itc-form__option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  accent-color: #1a1a1a;
  cursor: pointer;
}

.itc-form__option-label {
  font-size: 14px;
  color: #1a1a1a;
}

/* ============================================
   Error Message
   ============================================ */

.itc-form__error {
  display: none;
  font-size: 13px;
  color: #e74c3c;
  margin-top: 6px;
}

.itc-form__group--error .itc-form__error {
  display: block;
}

/* ============================================
   Submit Button
   ============================================ */

.itc-form__submit {
  text-align: center;
  margin-top: 48px;
}

.itc-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  padding: 18px 48px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #1a1a1a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.itc-form__btn:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.itc-form__btn:active {
  transform: translateY(0);
}

.itc-form__btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.itc-form__btn--loading {
  position: relative;
  color: transparent;
}

.itc-form__btn--loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: itc-spin 0.8s linear infinite;
}

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

/* ============================================
   Privacy Agreement
   ============================================ */

.itc-form__privacy {
  margin-top: 32px;
  padding: 24px;
  background: #f5f5f5;
  border-radius: 4px;
}

.itc-form__privacy-text {
  font-size: 13px;
  line-height: 1.8;
  color: #666;
  margin-bottom: 16px;
}

.itc-form__privacy-link {
  color: #1a1a1a;
  text-decoration: underline;
}

.itc-form__privacy-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.itc-form__privacy-check input {
  width: 18px;
  height: 18px;
  accent-color: #1a1a1a;
}

.itc-form__privacy-check label {
  font-size: 14px;
  cursor: pointer;
}

/* ============================================
   Contact Page Specific
   ============================================ */

.itc-contact {
  padding: 80px 0;
}

.itc-contact__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.itc-contact__header {
  text-align: center;
  margin-bottom: 48px;
}

.itc-contact__title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}

.itc-contact__lead {
  font-size: 15px;
  line-height: 1.8;
  color: #666;
}

/* Contact Methods (Tel, Email) */
.itc-contact__methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.itc-contact__method {
  padding: 32px;
  background: #f5f5f5;
  border-radius: 8px;
  text-align: center;
}

.itc-contact__method-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 12px;
}

.itc-contact__method-value {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
}

.itc-contact__method-note {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* ============================================
   Confirmation Page
   ============================================ */

.itc-confirm {
  max-width: 700px;
  margin: 0 auto;
}

.itc-confirm__table {
  width: 100%;
  border-collapse: collapse;
}

.itc-confirm__row {
  border-bottom: 1px solid #eee;
}

.itc-confirm__label {
  padding: 20px 16px 20px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  width: 180px;
  vertical-align: top;
}

.itc-confirm__value {
  padding: 20px 0;
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.itc-confirm__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 48px;
}

.itc-confirm__btn--back {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ddd;
}

.itc-confirm__btn--back:hover {
  background: #f5f5f5;
}

/* ============================================
   Thank You Page
   ============================================ */

.itc-thanks {
  text-align: center;
  padding: 80px 20px;
}

.itc-thanks__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 32px;
  background: #2ecc71;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.itc-thanks__icon::before {
  content: '✓';
  font-size: 36px;
  color: #fff;
}

.itc-thanks__title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.itc-thanks__text {
  font-size: 15px;
  line-height: 2;
  color: #666;
  margin-bottom: 32px;
}

.itc-thanks__link {
  display: inline-block;
  padding: 14px 32px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.itc-thanks__link:hover {
  background: #333;
}

/* ============================================
   Honeypot (Bot Protection)
   ============================================ */

.itc-form__honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .itc-form__title {
    font-size: 18px;
  }

  .itc-form__options {
    flex-direction: column;
    gap: 12px;
  }

  .itc-form__btn {
    width: 100%;
    min-width: auto;
  }

  .itc-contact__methods {
    grid-template-columns: 1fr;
  }

  .itc-contact__method-value {
    font-size: 20px;
  }

  .itc-confirm__label {
    width: 120px;
    padding: 16px 12px 16px 0;
  }

  .itc-confirm__value {
    padding: 16px 0;
  }

  .itc-confirm__actions {
    flex-direction: column;
  }

  .itc-thanks__title {
    font-size: 24px;
  }

}

/* ============================================
   Contact Page Specific Styles (Moved from php)
   ============================================ */

/* Contact Intro */
.contact-intro {
  text-align: center;
  margin-bottom: 48px;
}

.contact-intro__text {
  font-weight: 500;
  line-height: 2;
  color: var(--color-text);
}

/* Form Styles */
.contact-form {
  max-width: 700px;
  margin: 0 auto;
}

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

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text);
}

.form-required {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.form-radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-radio input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-radio__text {
  font-size: 15px;
  color: var(--color-text);
}

/* CF7 Compatibility for Radio Buttons */
.form-radio-group p {
  margin: 0;
}

.form-radio-group .wpcf7-form-control {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-radio-group .wpcf7-list-item {
  margin: 0;
  display: block;
}

.form-radio-group .wpcf7-list-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  margin: 0;
}

.form-radio-group .wpcf7-list-item input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}

.form-radio-group .wpcf7-list-item-label {
  font-size: 15px;
  color: var(--color-text);
  cursor: pointer;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Privacy Agreement */
.privacy-agreement {
  margin-top: 32px;
}

.privacy-agreement__box {
  background: #f8f9fa;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.8;
  color: var(--color-text);
}

.privacy-agreement__box ol {
  margin: 16px 0;
  padding-left: 24px;
}

.privacy-agreement__box ol li {
  margin-top: 16px;
}

.privacy-agreement__title {
  font-weight: 600;
}

.privacy-agreement__box ol p {
  font-weight: 400;
  margin: 8px 0;
}

.privacy-agreement__checkbox {
  text-align: center;
  margin-top: 20px;
}

.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.form-checkbox input {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.form-checkbox__text {
  font-size: 15px;
  color: var(--color-text);
}

.form-checkbox__text a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* CF7 Compatibility for Acceptance Checkbox */
.privacy-agreement__checkbox p {
  margin: 0;
  padding: 0;
}

.privacy-agreement__checkbox br {
  display: none;
}

/* Force label to behave as flex container for alignment */
.privacy-agreement__checkbox .form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  /* Ensure it wraps correctly if needed */
  flex-wrap: wrap;
  justify-content: center;
}

/* Unwrap CF7 spans visually so flex gap applies effectively between input and text */
.privacy-agreement__checkbox .wpcf7-form-control-wrap,
.privacy-agreement__checkbox .wpcf7-acceptance,
.privacy-agreement__checkbox .wpcf7-list-item {
  display: contents;
  /* Modern browsers: treats children as if they were direct children of label */
}

/* Fallback for 'display: contents' support/issues: ensure they don't break layout */
/* If display: contents is not desired, we would use inline-flex and reset margins */

.privacy-agreement__checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 0;
}

.privacy-agreement__checkbox .form-checkbox__text {
  font-size: 15px;
  color: var(--color-text);
  margin: 0;
}

.form-submit {
  text-align: center;
  margin-top: 40px;
}

.btn--large {
  padding: 18px 64px;
  font-size: 16px;
}

/* Phone Contact */
.phone-contact {
  margin-top: 80px;
}

.phone-contact__box {
  text-align: center;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 40px;
}

.phone-contact__label {
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 16px;
  line-height: 1.6;
}

.phone-contact__tel {
  font-family: var(--font-en-heading);
  font-size: 42px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.phone-contact__freedial {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  font-family: var(--font-jp);
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 4px;
  margin-right: 12px;
  vertical-align: middle;
}

.phone-contact__time {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.sp-only {
  display: none;
}

@media (max-width: 768px) {
  .contact-intro__text {
    font-size: 14px;
  }

  .phone-contact__box {
    padding: 32px 24px;
  }

  .phone-contact__tel {
    font-size: 28px;
  }

  .phone-contact__freedial {
    display: block;
    margin-right: 0;
    margin-bottom: 8px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }

  .sp-only {
    display: inline;
    /* fallback */
    display: block;
  }
}

/* CF7 Message Styles */
.wpcf7 form.wpcf7-form .wpcf7-response-output {
  margin: 24px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;

  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text, #333);
  text-align: center;
}

/* Success Message */
.wpcf7 form.wpcf7-form.sent .wpcf7-response-output {
  color: #065f46;
}

/* Error / Validation Message */
.wpcf7 form.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7 form.wpcf7-form.failed .wpcf7-response-output,
.wpcf7 form.wpcf7-form.aborted .wpcf7-response-output,
.wpcf7 form.wpcf7-form.payment-required .wpcf7-response-output {
  color: #dc2626;
}

/* Spam / Warning */
.wpcf7 form.wpcf7-form.spam .wpcf7-response-output,
.wpcf7 form.wpcf7-form.unaccepted .wpcf7-response-output {
  color: #92400e;
}

/* Input Validation Tips */
.contact-form .wpcf7-not-valid-tip {
  display: block;
  font-size: 12px;
  color: #dc2626;
  margin-top: 6px;
  font-weight: 500;
  text-align: left;
}