/* ============================================================
   MOXIMTECH – APPLY PAGE STYLES
   ============================================================ */

/* ── HERO ───────────────────────────────────────────────── */
.apply-hero {
  padding: 80px 0 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--glass-border);
}
.apply-hero .container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 0.7; }

.apply-hero-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.03em;
  margin: 12px 0 14px;
  line-height: 1.2;
}
.apply-position-name {
  color: var(--primary);
}
.apply-hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── APPLY SECTION ──────────────────────────────────────── */
.apply-section {
  padding: 80px 0 120px;
  background: var(--bg2);
}
.apply-section .container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.apply-wrapper {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

/* ── FORM BOX ───────────────────────────────────────────── */
.apply-form-box {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 44px 40px;
  box-shadow: 0 4px 24px rgba(0, 60, 120, 0.08);
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.form-group:last-of-type { margin-bottom: 28px; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-input {
  background: var(--surface);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r);
  color: var(--text-dark);
  font-size: 15px;
  font-family: var(--font);
  height: 48px;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.form-input[readonly] {
  background: var(--bg2);
  color: var(--primary);
  font-weight: 600;
  cursor: default;
}
.form-input::placeholder { color: var(--muted2); }
.form-input:focus:not([readonly]) {
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  background: var(--surface);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r);
  color: var(--text-dark);
  font-size: 15px;
  font-family: var(--font);
  height: 180px;
  padding: 14px 16px;
  outline: none;
  resize: vertical;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.form-textarea::placeholder { color: var(--muted2); }
.form-textarea:focus {
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input.invalid,
.form-textarea.invalid {
  border-color: #e53935;
  background: rgba(229,57,53,0.04);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.12);
}
.field-error {
  color: #e53935;
  font-size: 12px;
  margin-top: 4px;
  display: block;
  min-height: 16px;
}

.send-btn {
  width: 100%;
  justify-content: center;
  font-size: 16px;
  padding: 14px 28px;
}

.form-submit-error {
  display: none;
  background: rgba(229,57,53,0.08);
  border: 1px solid rgba(229,57,53,0.28);
  border-radius: var(--r);
  color: #c62828;
  font-size: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

/* ── SUCCESS PANEL ───────────────────────────────────────── */
.form-success {
  display: none;
  text-align: center;
  padding: 52px 24px 40px;
  animation: successFadeIn 0.4s var(--ease) both;
}
@keyframes successFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.success-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.success-checkmark { width: 76px; height: 76px; display: block; }
.checkmark-circle {
  stroke: #27ae60;
  stroke-width: 2;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: ckDrawCircle 0.55s ease forwards;
}
.checkmark-check {
  stroke: #27ae60;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: ckDrawCheck 0.38s 0.5s ease forwards;
}
@keyframes ckDrawCircle { to { stroke-dashoffset: 0; } }
@keyframes ckDrawCheck  { to { stroke-dashoffset: 0; } }
.success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.success-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ── INFO BOX ───────────────────────────────────────────── */
.apply-info-box {
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  position: sticky;
  top: 90px;
  box-shadow: 0 4px 24px rgba(0, 60, 120, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.info-brand {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}
.info-logo { width: 140px; margin-bottom: 10px; display: block; }
.info-company { font-size: 14px; color: var(--muted); line-height: 1.5; }

.info-list { display: flex; flex-direction: column; gap: 4px; }
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
}
.info-item:last-child { border-bottom: none; }
.info-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
}
.info-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.info-value {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.55;
  transition: color 0.2s;
}
.info-value:hover { color: var(--primary); }
.info-value.static { pointer-events: none; }

.apply-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--glass-hover);
  border-radius: var(--r);
  border: 1px solid var(--glass-border);
}
.apply-note svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}
.apply-note p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ── REQUIRED MARK ──────────────────────────────────────── */
.form-label.req::after {
  content: '*';
  color: #e53935;
  margin-left: 4px;
}

/* ── SELECT ─────────────────────────────────────────────── */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

/* ── FILE UPLOAD ────────────────────────────────────────── */
.form-file {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px dashed var(--glass-border);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer;
  background: var(--bg2);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.form-file:hover { border-color: var(--primary); background: var(--primary-dim); }
/* 鍵盤聚焦到隱形 file input 時，外框給焦點指示 */
.form-file:focus-within { border-color: var(--primary); background: var(--primary-dim); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-file svg { width: 20px; height: 20px; stroke: var(--primary); flex-shrink: 0; }
.form-file-text { font-size: 14px; color: var(--muted); word-break: break-all; }
.form-file.has-file { border-style: solid; border-color: var(--primary); background: var(--primary-dim); }
.form-file.has-file .form-file-text { color: var(--text-dark); font-weight: 600; }
.form-file.invalid { border-style: solid; border-color: #e53935; background: rgba(229,57,53,0.04); }
/* file input 視覺隱藏但保留可聚焦（無障礙），取代原本的 hidden 屬性 */
.sr-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── PRIVACY CHECKBOX ───────────────────────────────────── */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin: 4px 0 6px;
}
.form-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.form-check-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--glass-border);
  border-radius: 5px;
  background: var(--surface);
  margin-top: 1px;
  position: relative;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.form-check input:checked + .form-check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.form-check input:checked + .form-check-box::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.form-check input:focus-visible + .form-check-box { box-shadow: 0 0 0 3px var(--primary-glow); }
.form-check-text { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── PREVIEW ────────────────────────────────────────────── */
.preview-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 24px;
}
.preview-list {
  margin: 0 0 24px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  overflow: hidden;
}
.preview-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 14px;
}
.preview-row:last-child { border-bottom: none; }
.preview-row:nth-child(odd) { background: var(--bg2); }
.preview-row dt { color: var(--muted); font-weight: 600; }
.preview-row dd {
  margin: 0;
  color: var(--text-dark);
  word-break: break-word;
  white-space: pre-wrap;
}
.preview-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.preview-actions .send-btn { width: auto; flex: 1; }
.preview-back { white-space: nowrap; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .apply-wrapper { grid-template-columns: 1fr; }
  .apply-info-box { position: static; }
}
@media (max-width: 600px) {
  .apply-form-box { padding: 28px 20px; }
  .form-row.two-col { grid-template-columns: 1fr; }
  .apply-hero { padding: 48px 0 40px; }
  .apply-section { padding: 40px 0 80px; }
  .preview-row { grid-template-columns: 1fr; gap: 4px; }
  .preview-actions { flex-direction: column-reverse; }
  .preview-actions .send-btn,
  .preview-back { width: 100%; }
}

/* ── 深色模式微調 ──────────────────────────────────────── */
html[data-theme="dark"] .info-logo { filter: brightness(0) invert(1); opacity: 0.9; }
