/* ============================================
   草本酒坊 - 商家入驻页面样式
   ============================================ */

/* ── 页面头部 ── */
.coop-hero {
  text-align: center;
  padding: var(--space-16) 0 var(--space-10);
  background: linear-gradient(180deg, oklch(19% 0.015 60) 0%, var(--bg-base) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.coop-hero-eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--text-accent);
  letter-spacing: 0.2em;
  margin-bottom: var(--space-3);
}

.coop-hero-title {
  font-family: var(--font-cn);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: 0.08em;
}

.coop-hero-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

/* ── 步骤条 ── */
.coop-steps-bar {
  padding: var(--space-6) 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 480px;
  margin: 0 auto;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 2px solid var(--border-default);
  transition: all var(--duration-normal) var(--ease-out-quart);
}

.step-active .step-num {
  background: var(--color-accent);
  color: var(--bg-base);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-gold);
}

.step-done .step-num {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}

.step-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  transition: color var(--duration-normal);
}

.step-active .step-text {
  color: var(--text-accent);
  font-weight: var(--weight-medium);
}

.step-done .step-text {
  color: var(--color-success);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-default);
  margin: 0 var(--space-4);
  margin-bottom: 22px; /* 对齐文字上方 */
  min-width: 40px;
}

/* ── 表单区域 ── */
.coop-form-section {
  padding: var(--space-10) 0 var(--space-16);
}

.form-panel {
  animation: fadeInUp 0.5s var(--ease-out-expo);
}

.form-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.form-panel-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: oklch(75% 0.15 85 / 0.1);
  color: var(--text-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-panel-title {
  font-family: var(--font-cn);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.form-panel-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.form-body {
  margin-bottom: var(--space-8);
}

/* ── 表单组 ── */
.form-group {
  margin-bottom: var(--space-6);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-required {
  color: var(--color-primary-light);
  margin-left: 2px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.input-error {
  border-color: var(--color-primary-light) !important;
  box-shadow: 0 0 0 3px oklch(45% 0.15 25 / 0.2) !important;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* ── 上传区域 ── */
.upload-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  margin-top: var(--space-8);
}

.upload-section-title:first-child {
  margin-top: 0;
}

.required-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  background: oklch(45% 0.15 25 / 0.15);
  color: var(--color-primary-light);
  border-radius: var(--radius-sm);
}

.optional-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: oklch(70% 0.02 70 / 0.15);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.upload-card {
  margin-bottom: var(--space-2);
}

.upload-area {
  position: relative;
  aspect-ratio: 4/3;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-quart);
  overflow: hidden;
  background: var(--bg-surface);
}

.upload-area:hover {
  border-color: var(--color-accent);
  background: oklch(75% 0.15 85 / 0.04);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
}

.upload-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.upload-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.upload-tip {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.upload-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
  z-index: 2;
}

.upload-remove:hover {
  background: var(--color-primary);
  transform: scale(1.1);
}

/* ── 表单操作按钮 ── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.form-actions-between {
  justify-content: space-between;
}

/* ── 确认摘要 ── */
.confirm-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.confirm-title {
  font-family: var(--font-cn);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.confirm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.confirm-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.confirm-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.confirm-value {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
  word-break: break-all;
}

/* ── 资质文件确认 ── */
.confirm-files {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.confirm-file-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

.confirm-file-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirm-file-icon.has-file {
  background: oklch(55% 0.12 145 / 0.15);
  color: var(--color-success);
}

.confirm-file-icon:not(.has-file) {
  background: oklch(55% 0.18 25 / 0.1);
  color: var(--text-muted);
}

.confirm-file-name {
  font-size: var(--text-sm);
  color: var(--text-primary);
  flex: 1;
}

.confirm-file-status {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.confirm-file-status.uploaded {
  color: var(--color-success);
}

.confirm-file-status.missing {
  color: var(--text-muted);
}

/* ── 协议区域 ── */
.agreement-section {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.agreement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.agreement-header:hover {
  background: var(--bg-elevated);
}

.agreement-title {
  font-family: var(--font-cn);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.agreement-arrow {
  color: var(--text-muted);
  transition: transform var(--duration-normal) var(--ease-out-quart);
}

.agreement-arrow.open {
  transform: rotate(180deg);
}

.agreement-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out-quart);
}

.agreement-body.open {
  max-height: 2000px;
}

.agreement-content {
  padding: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-height: 400px;
  overflow-y: auto;
}

.agreement-content h4 {
  font-family: var(--font-cn);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

.agreement-content h4:first-child {
  margin-top: 0;
}

.agreement-content p {
  margin-bottom: var(--space-2);
}

.agreement-content strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

/* ── 协议勾选 ── */
.agreement-check {
  margin-bottom: var(--space-6);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--duration-fast);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid var(--bg-base);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.checkbox-text a {
  color: var(--text-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkbox-text a:hover {
  color: var(--color-accent-light);
}

/* ── 提交成功 ── */
.success-content {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.success-icon {
  margin-bottom: var(--space-8);
}

.success-icon svg {
  color: var(--color-success);
}

.success-circle {
  stroke-dashoffset: 226;
  animation: circleIn 0.6s ease forwards;
}

.success-check {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: checkIn 0.4s 0.4s ease forwards;
}

@keyframes circleIn {
  to { stroke-dashoffset: 0; }
}

@keyframes checkIn {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-family: var(--font-cn);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.success-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.success-number {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-accent);
  font-weight: var(--weight-medium);
  letter-spacing: 0.05em;
  margin: var(--space-6) 0;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* ── 按钮加载状态 ── */
.btn-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: var(--space-2);
}

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

/* ── 响应式 ── */
@media (max-width: 768px) {
  .coop-hero {
    padding: var(--space-10) 0 var(--space-6);
  }

  .coop-hero-title {
    font-size: var(--text-2xl);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .confirm-grid {
    grid-template-columns: 1fr;
  }

  .step-text {
    font-size: 0.65rem;
  }

  .step-num {
    width: 30px;
    height: 30px;
    font-size: var(--text-xs);
  }

  .form-actions-between {
    flex-direction: column-reverse;
    gap: var(--space-3);
  }

  .form-actions-between .btn {
    width: 100%;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-actions .btn {
    width: 100%;
  }

  .agreement-content {
    max-height: 300px;
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .coop-steps-bar {
    padding: var(--space-4) 0;
  }

  .steps-bar {
    max-width: 100%;
  }

  .step-line {
    margin: 0 var(--space-2);
    margin-bottom: 20px;
  }

  .form-panel-header {
    flex-direction: column;
    text-align: center;
  }
}
