/* ============================================
   產品資料下載表單 - MoriForms Skin Styles
   ============================================ */

/* 必填星號樣式 */
.moriforms-required-star {
  color: #ff0000;
  font-weight: bold;
}

/* 表單容器 */
.product-download-form-wrapper {
  padding: 2em;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
}

/* 表單欄位容器 - Grid 排版 */
.form-fields-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5em;
}

/* ============================================
   Checkbox 區塊樣式
   ============================================ */

/* Checkbox 區塊佔滿整行 */
.moriforms-checkbox-wrapper,
#field-wrapper-inquiry_types {
  grid-column: 1 / -1;
  margin-bottom: 0.5em;
}

.moriforms-checkbox-wrapper legend,
#field-wrapper-inquiry_types .moriforms-field-label {
  font-weight: bold;
  margin-bottom: 0.8em;
  font-size: 1em;
  display: block;
}

/* Checkbox 項目橫向排列 */
.moriforms-checkbox-wrapper .moriforms-checkbox-options,
#field-wrapper-inquiry_types .moriforms-checkbox-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 2em;
}

.moriforms-checkbox-item {
  display: inline-flex;
  align-items: center;
  margin-right: 2em;
  margin-bottom: 0.8em;
}

.moriforms-checkbox-item input[type="checkbox"] {
  margin-right: 0.4em;
  width: auto;
}

.moriforms-checkbox-item label {
  margin: 0;
  font-weight: normal;
  display: inline;
}

/* Checkbox 錯誤訊息 */
#error-inquiry_types {
  display: block;
  margin-top: 0.5em;
  grid-column: 1 / -1;
}

/* ============================================
   欄位佈局控制
   ============================================ */

/* 產品洽詢內容 - 佔滿整行 */
.full-width,
#field-wrapper-inquiry_content {
  grid-column: 1 / -1;
}

/* 三欄佈局 */
.col-3 {
  grid-column: span 1;
}

/* 兩欄佈局 - 左側 */
.col-2-left,
#field-wrapper-contact_name,
#field-wrapper-phone_ext {
  grid-column: 1 / 2;
}

/* 兩欄佈局 - 右側（跨兩欄） */
.col-2-right,
#field-wrapper-customer_email,
#field-wrapper-mobile_phone {
  grid-column: 2 / 4;
}

/* ============================================
   基礎欄位樣式
   ============================================ */

.form-field-wrapper,
.moriforms-field-wrapper {
  margin-bottom: 0;
}

.form-field-wrapper label,
.moriforms-field-wrapper label,
.moriforms-field-label {
  display: inline-block;
  font-weight: bold;
  margin-bottom: 0.5em;
}

.form-field-wrapper input,
.form-field-wrapper textarea,
.moriforms-field-wrapper input,
.moriforms-field-wrapper textarea {
  width: 100%;
  padding: 0.8em;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 1em;
}

.form-field-wrapper input:focus,
.form-field-wrapper textarea:focus,
.moriforms-field-wrapper input:focus,
.moriforms-field-wrapper textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.form-field-wrapper textarea,
.moriforms-field-wrapper textarea {
  min-height: 120px;
  resize: vertical;
}

/* 必填欄位背景色 */
.is-required input,
.is-required textarea {
  background-color: #fffaf0;
}

/* ============================================
   表單底部按鈕
   ============================================ */

.form-footer {
  margin-top: 2em;
  text-align: center;
  grid-column: 1 / -1;
}

.form-footer button[type="submit"] {
  padding: 0.8em 3em;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s;
}

.form-footer button[type="submit"]:hover {
  background-color: #0056b3;
}

.form-footer button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ============================================
   訊息樣式
   ============================================ */

.form-messages {
  padding: 1em;
  margin-bottom: 1em;
  border-radius: 4px;
  display: none;
}

.form-messages.success {
  display: block;
  background-color: #eaf5e8;
  border: 1px solid #6fbf6b;
  color: #2a5728;
}

.form-messages.error {
  display: block;
  background-color: #fdecea;
  border: 1px solid #d9534f;
  color: #a94442;
}

.field-error,
.moriforms-field-error {
  color: #a94442;
  font-size: 0.9em;
  margin-top: 0.4em;
}

/* ============================================
   下載區塊樣式（表單完成後顯示）
   ============================================ */

/* 表單區域 */
.download-form-area {
  margin-bottom: 2em;
}

.download-form-area h3 {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.5em;
}

.download-notice {
  color: #666;
  margin-bottom: 1.5em;
}

/* 下載區塊 - 預設隱藏 */
.download-section {
  display: none;
  margin-top: 2em;
  padding: 1.5em;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
  border-radius: 12px;
  animation: fadeInUp 0.5s ease;
}

.download-section.is-visible {
  display: block;
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.download-section h3 {
  color: #0369a1;
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.3em;
}

.file-download-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.file-download-item {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 1em;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.file-download-item:hover {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
  transform: translateY(-1px);
}

.file-icon {
  font-size: 1.5em;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: #333;
}

.file-meta {
  font-size: 0.85em;
  color: #666;
  margin-top: 0.25em;
}

.file-meta .file-type {
  background: #e0e0e0;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  margin-right: 0.5em;
}

.download-icon {
  font-size: 1.2em;
  color: #007bff;
}

/* ============================================
   響應式設計
   ============================================ */

@media (max-width: 768px) {
  .form-fields-container {
    grid-template-columns: 1fr;
  }
  
  .col-3,
  .col-2-left,
  .col-2-right,
  #field-wrapper-inquiry_content,
  #field-wrapper-contact_name,
  #field-wrapper-customer_email,
  #field-wrapper-phone_ext,
  #field-wrapper-mobile_phone {
    grid-column: 1;
  }
  
  .moriforms-checkbox-wrapper .moriforms-checkbox-options,
  #field-wrapper-inquiry_types .moriforms-checkbox-options {
    flex-direction: column;
    gap: 0.5em;
  }
  
  .moriforms-checkbox-item {
    display: flex;
    margin-right: 0;
    margin-bottom: 0.5em;
  }
}
