/**
 * 阿根廷签证申请表 - 单页表单样式
 * 现代简约风格 (Minimal Modern)
 * 响应式设计，支持桌面/平板/移动端
 */

/* ==================== CSS 变量定义 ==================== */
:root {
  /* 全部映射到 brand.css 的设计变量，配色与字体随设计体系统一 */
  --primary-color: var(--vs-navy);
  --primary-hover: var(--vs-navy-2);
  --primary-active: var(--vs-ink);
  --primary-light: var(--vs-line);
  --primary-lighter: var(--vs-bg);

  --accent-color: var(--vs-navy);
  --accent-hover: var(--vs-navy-2);

  --success-color: var(--vs-success);
  --success-light: var(--vs-success-soft);
  --error-color: var(--vs-danger);
  --error-light: var(--vs-danger-soft);
  --warning-color: var(--vs-warning);
  --warning-light: var(--vs-warning-soft);

  --neutral-50: var(--vs-bg);
  --neutral-100: var(--vs-bg-deep);
  --neutral-200: var(--vs-line);
  --neutral-300: var(--vs-line-strong);
  --neutral-400: var(--vs-faint);
  --neutral-500: var(--vs-muted);
  --neutral-600: var(--vs-muted);
  --neutral-700: var(--vs-text);
  --neutral-800: var(--vs-ink);
  --neutral-900: var(--vs-ink);
  --white: #ffffff;
  --black: #000000;

  --header-height: 80px;
  --footer-height: 72px;
  --sidebar-width: 280px;
  --content-max-width: 800px;
  --container-max-width: 1400px;

  --spacing-section: 64px;
  --spacing-subsection: 48px;
  --spacing-group: 32px;
  --spacing-field: 24px;

  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 4px 12px rgba(11, 26, 51, .06);
  --shadow-lg: 0 8px 24px rgba(11, 26, 51, .08);
  --shadow-xl: 0 12px 32px rgba(11, 26, 51, .1);
  --shadow-input-focus: 0 0 0 3px rgba(11, 26, 51, .1);
  --shadow-button-hover: none;

  --font-family-sans: var(--vs-font);
}

/* ==================== 基础重置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--neutral-700);
  background: var(--vs-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

/* ==================== 固定头部 ==================== */
.visa-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--neutral-200);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: var(--container-max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-title h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--neutral-800);
  letter-spacing: -0.01em;
  margin: 0;
}

.header-title p {
  font-size: 14px;
  color: var(--neutral-500);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ==================== 主内容区 ==================== */
.main-content {
  margin-top: var(--header-height);
  margin-bottom: var(--footer-height);
  padding: 48px 32px;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  scroll-padding-top: calc(var(--header-height) + 24px);
}

.form-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* ==================== 表单区块 ==================== */
.form-section {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--vs-r-md);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out both;
}

.form-section:hover {
  box-shadow: var(--shadow-md);
}

.form-section.completed {
  border-color: var(--success-color);
  background: var(--white);
}

.form-section.active {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

/* 依次淡入动画 */
.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }
.form-section:nth-child(6) { animation-delay: 0.6s; }
.form-section:nth-child(7) { animation-delay: 0.7s; }

/* ==================== 子区块 ==================== */
.subsection {
  margin-bottom: 32px;
}

.subsection:last-child {
  margin-bottom: 0;
}

/* ==================== 表单布局 ==================== */
.form-row {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.form-row:last-child {
  margin-bottom: 0;
}

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

.form-row.double {
  grid-template-columns: repeat(2, 1fr);
}

.form-row.triple {
  grid-template-columns: repeat(3, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
}

/* ==================== 表单标签 ==================== */
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-700);
  margin-bottom: 8px;
  line-height: 1.5;
}

.required-mark {
  color: var(--error-color);
  margin-left: 4px;
}

.optional-mark {
  color: var(--neutral-500);
  font-weight: 400;
  margin-left: 4px;
}

/* ==================== 输入框 ==================== */
.input-field {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  font-size: 16px;
  color: var(--neutral-700);
  background: var(--white);
  transition: all 0.2s ease;
}

.input-field::placeholder {
  color: var(--neutral-400);
}

.input-field:hover {
  border-color: var(--primary-color);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-input-focus);
}

.input-field:disabled {
  background: var(--neutral-100);
  color: var(--neutral-500);
  cursor: not-allowed;
}

.input-field.error {
  border-color: var(--error-color);
}

.input-field.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.input-field.success {
  border-color: var(--success-color);
}

.input-field.success:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* ==================== 下拉选择框 ==================== */
.select-field {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  font-size: 16px;
  color: var(--neutral-700);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

.select-field:hover {
  border-color: var(--primary-color);
}

.select-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-input-focus);
}

/* ==================== 文本域 ==================== */
.textarea-field {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  font-size: 16px;
  color: var(--neutral-700);
  background: var(--white);
  font-family: var(--font-family-sans);
  line-height: 1.5;
  resize: vertical;
  transition: all 0.2s ease;
}

.textarea-field::placeholder {
  color: var(--neutral-400);
}

.textarea-field:hover {
  border-color: var(--primary-color);
}

.textarea-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-input-focus);
}

/* ==================== 单选按钮 ==================== */
.radio-group {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.radio-option input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-300);
  border-radius: 50%;
  margin-right: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.radio-option input[type="radio"]:hover {
  border-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked {
  border-color: var(--primary-color);
  background: var(--white);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
}

.radio-option input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.radio-option span {
  font-size: 16px;
  color: var(--neutral-700);
}

/* ==================== 提示文本 ==================== */
.hint-text {
  font-size: 13px;
  color: var(--neutral-500);
  margin-top: 6px;
  line-height: 1.5;
}

.hint-text.error {
  color: var(--error-color);
}

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

.hint-text.warning {
  color: var(--warning-color);
}

/* ==================== 按钮系统 ==================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  background: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--primary-active);
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.20);
}

.btn-primary:disabled {
  background: var(--neutral-300);
  color: var(--neutral-500);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--neutral-700);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-lighter);
}

.btn-secondary:active {
  background: var(--primary-light);
}

.btn-secondary:focus {
  outline: none;
  box-shadow: var(--shadow-input-focus);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-text:hover {
  color: var(--primary-color);
  background: var(--neutral-100);
}

.btn-text:active {
  background: var(--neutral-200);
}

/* ==================== 固定底部 ==================== */
.footer-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--neutral-200);
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.footer-container {
  max-width: var(--content-max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-right {
  display: flex;
  gap: 16px;
}

/* ==================== 悬浮返回顶部按钮 ==================== */
.floating-back-to-top {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.floating-back-to-top:active {
  background: var(--primary-active);
  transform: translateY(0);
}

/* ==================== 日期选择器 ==================== */
.datepicker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.datepicker-overlay.active {
  opacity: 1;
}

.datepicker-calendar {
  width: 320px;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  padding: 16px;
  transform: translateY(-8px);
  opacity: 0;
  transition: all 0.2s ease;
}

.datepicker-calendar.active {
  transform: translateY(0);
  opacity: 1;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 8px;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--neutral-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.calendar-nav-btn:hover:not(:disabled) {
  background: var(--neutral-100);
  color: var(--primary-color);
}

.calendar-nav-btn:active {
  transform: scale(0.95);
}

.calendar-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--neutral-800);
  display: flex;
  justify-content: center;
  gap: 4px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-500);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  color: var(--neutral-700);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day:hover:not(:disabled) {
  background: var(--neutral-100);
  color: var(--primary-color);
}

.calendar-day.today {
  background: var(--primary-lighter);
  color: var(--primary-color);
  font-weight: 600;
}

.calendar-day.today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary-color);
}

.calendar-day.selected {
  background: var(--primary-color);
  color: var(--white);
  font-weight: 600;
}

.calendar-day.selected:hover {
  background: var(--primary-hover);
}

.calendar-day.other-month {
  color: var(--neutral-400);
}

.calendar-day.disabled {
  color: var(--neutral-300);
  cursor: not-allowed;
  pointer-events: none;
}

.calendar-day.weekend:not(.selected):not(.today) {
  color: var(--error-color);
}

.calendar-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--neutral-200);
}

.calendar-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-btn.btn-text {
  background: transparent;
  color: var(--neutral-600);
}

.calendar-btn.btn-text:hover {
  background: var(--neutral-100);
  color: var(--neutral-800);
}

.calendar-btn.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.calendar-btn.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-button-hover);
}

.calendar-btn.btn-primary:active {
  background: var(--primary-active);
  transform: scale(0.98);
}

/* ==================== 文件上传 ==================== */
.upload-area {
  border: 2px dashed var(--neutral-300);
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--neutral-50);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: var(--primary-lighter);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: scale(1.02);
}

.upload-text {
  font-size: 16px;
  color: var(--neutral-600);
  margin-bottom: 8px;
}

.upload-text .highlight {
  color: var(--primary-color);
  font-weight: 600;
}

.upload-hint {
  font-size: 13px;
  color: var(--neutral-500);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  margin-top: 16px;
  transition: all 0.2s ease;
}

.file-preview:hover {
  border-color: var(--primary-color);
  background: var(--primary-lighter);
}

.file-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--primary-lighter);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-700);
  margin-bottom: 4px;
}

.file-size {
  font-size: 12px;
  color: var(--neutral-500);
}

.file-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--neutral-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-remove:hover {
  background: var(--error-light);
  color: var(--error-color);
}

/* ==================== 自动保存指示器 ==================== */
.auto-save-indicator {
  position: fixed;
  top: 90px;
  right: 32px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  z-index: 1001;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.auto-save-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.auto-save-indicator.saving {
  background: var(--primary-lighter);
  color: var(--primary-color);
  border: 1px solid var(--primary-light);
}

.auto-save-indicator.saved {
  background: var(--success-light);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}


/* ==================== 动画 ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ==================== 响应式设计 ==================== */

/* 平板端 (768px - 1024px) */
@media (max-width: 1024px) {
  .form-row.triple {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 移动端 (<768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --footer-height: 180px;
  }

  /* 主内容区调整 */
  .main-content {
    padding: 24px 16px;
  }

  .footer-container {
    padding: 0 16px;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: center;
  }

  .footer-right {
    flex-direction: column;
    gap: 8px;
  }

  .footer-right button {
    width: 100%;
  }

  /* 悬浮返回顶部按钮移动端调整 */
  .floating-back-to-top {
    bottom: 200px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  /* 头部调整 */
  .visa-header {
    height: var(--header-height);
  }

  .header-container {
    padding: 0 16px;
  }

  .header-title h1 {
    font-size: 16px;
  }

  .header-title p {
    display: none;
  }

  /* 区块调整 */
  .form-section {
    padding: 24px 16px;
    border-radius: 12px;
  }

  /* 表单布局 */
  .form-row.double,
  .form-row.triple {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* 日历移动端优化 */
  .datepicker-calendar {
    width: calc(100vw - 32px);
    max-width: 360px;
  }

  .calendar-day {
    min-height: 44px;
  }

  /* 自动保存指示器 */
  .auto-save-indicator {
    top: 70px;
    right: 16px;
  }
}

/* 大屏适配 (>1440px) */
@media (min-width: 1440px) {
  .form-container {
    max-width: 900px;
  }
}

/* 打印样式 */
@media print {
  .visa-header,
  .footer-actions,
  .auto-save-indicator {
    display: none !important;
  }

  .main-content {
    margin: 0;
    padding: 0;
  }

  .form-section {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* ==================== 杂志风标题（覆盖各页内联样式） ==================== */
.form-section .section-title {
  font-family: var(--vs-font-display);
  font-size: var(--vs-fs-xl);
  font-weight: 600;
  color: var(--vs-ink);
}
.form-section .section-title::before { display: none; }
