/* ===================================================
   Resume Form - Styles
   サイトカラー: #D8746A (primary), #F6B09A (secondary), #1A365D (dark)
   =================================================== */

/* --- Section & Layout --- */
.resume-form-section {
  padding: 40px 0 80px;
  background: #f7f6f2;
  min-height: 100vh;
}
.resume-form-section .content-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}
.resume-form-heading {
  font-size: 22px;
  font-weight: 700;
  color: #1A365D;
  text-align: center;
  margin-bottom: 8px;
}
.resume-form-lead {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin-bottom: 32px;
}

/* --- Step Indicator --- */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
}
.step-indicator-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  max-width: 100px;
  position: relative;
}
.step-indicator-item::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 2px;
  background: #ddd;
}
.step-indicator-item:last-child::after {
  display: none;
}
.step-indicator-item.active::after,
.step-indicator-item.completed::after {
  background: #D8746A;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ddd;
  color: #999;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background 0.3s, color 0.3s;
}
.step-indicator-item.active .step-num {
  background: #D8746A;
  color: #fff;
}
.step-indicator-item.completed .step-num {
  background: #1A365D;
  color: #fff;
}
.step-label {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  transition: color 0.3s;
}
.step-indicator-item.active .step-label {
  color: #D8746A;
  font-weight: 700;
}
.step-indicator-item.completed .step-label {
  color: #1A365D;
}

/* --- Form Steps --- */
.form-step {
  display: none;
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.form-step-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A365D;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #D8746A;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.form-label.required::after {
  content: '必須';
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #D8746A;
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #D8746A;
  box-shadow: 0 0 0 3px rgba(216, 116, 106, 0.15);
}
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}
.form-error-message {
  font-size: 12px;
  color: #e53e3e;
  margin-top: 4px;
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* --- Row layouts --- */
.form-row {
  display: flex;
  gap: 12px;
}
.form-row--half > * {
  flex: 1;
}
.form-row--ym {
  gap: 8px;
}
.form-row--ym > select {
  flex: 1;
}
.form-row--qual {
  gap: 12px;
  align-items: flex-end;
}
.form-group--qual-name {
  flex: 2;
}
.form-group--qual-date {
  flex: 1.2;
}

/* --- Photo Upload --- */
.photo-upload-area {
  position: relative;
}
.form-file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.photo-upload-placeholder {
  border: 2px dashed #d0d0d0;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  color: #999;
  transition: border-color 0.2s, background 0.2s;
}
.photo-upload-placeholder:hover {
  border-color: #D8746A;
  background: rgba(216, 116, 106, 0.03);
}
.photo-upload-placeholder p {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.photo-upload-note {
  font-size: 12px;
  color: #aaa;
}
.photo-preview {
  position: relative;
  display: inline-block;
}
.photo-preview img {
  max-width: 150px;
  max-height: 200px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
}
.photo-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e53e3e;
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* --- Checkbox --- */
.form-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}
.form-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #D8746A;
  cursor: pointer;
}
.form-check-label--agree a {
  color: #D8746A;
  text-decoration: underline;
}

/* --- Divider --- */
.form-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 24px 0;
}

/* --- Career & Qualification blocks --- */
.career-block {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 24px 20px;
  margin-bottom: 16px;
  position: relative;
  background: #fafafa;
}
.career-block-title {
  font-size: 15px;
  font-weight: 700;
  color: #1A365D;
  margin-bottom: 16px;
}
.career-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #999;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.career-remove-btn:hover {
  color: #e53e3e;
  border-color: #e53e3e;
}
.qualification-row {
  margin-bottom: 12px;
  position: relative;
  padding-right: 36px;
}
.qualification-remove-btn {
  position: absolute;
  top: 8px;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #999;
  border: none;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qualification-remove-btn:hover {
  background: #e53e3e;
  color: #fff;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-next {
  background: #D8746A;
  color: #fff;
}
.btn-next:hover {
  background: #c4635a;
}
.btn-prev {
  background: #e8e8e8;
  color: #666;
}
.btn-prev:hover {
  background: #ddd;
}
.btn-submit {
  background: #1A365D;
  color: #fff;
  padding: 14px 48px;
  font-size: 16px;
}
.btn-submit:hover {
  background: #142c4d;
}
.btn-submit:disabled {
  background: #aaa;
  cursor: not-allowed;
}
.btn-add-career,
.btn-add-qualification {
  display: block;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 2px dashed #D8746A;
  border-radius: 8px;
  color: #D8746A;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}
.btn-add-career:hover,
.btn-add-qualification:hover {
  background: rgba(216, 116, 106, 0.05);
}
.btn-add-career:disabled,
.btn-add-qualification:disabled {
  border-color: #ccc;
  color: #ccc;
  cursor: not-allowed;
}

/* --- Help text --- */
.form-help-text {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 8px;
}

/* --- Navigation --- */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

/* --- Completion --- */
.completion-message {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.completion-icon {
  margin-bottom: 20px;
}
.completion-title {
  font-size: 22px;
  font-weight: 700;
  color: #1A365D;
  margin-bottom: 12px;
}
.completion-text {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 32px;
}
.completed-action-wrapper {
  margin-top: 24px;
}
.completed-totop-btn {
  display: inline-block;
  padding: 12px 36px;
  background: #D8746A;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s;
}
.completed-totop-btn:hover {
  background: #c4635a;
}

/* --- Education dynamic blocks --- */
.edu-block {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 24px 20px;
  margin-bottom: 16px;
  position: relative;
  background: #fafafa;
}
.edu-block-enter {
  animation: fadeIn 0.3s ease;
}
.edu-block-title {
  font-size: 15px;
  font-weight: 700;
  color: #1A365D;
  margin-bottom: 16px;
}
.edu-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 50%;
  color: #999;
  font-size: 18px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}
.edu-remove-btn:hover {
  color: #e53e3e;
  border-color: #e53e3e;
}
.btn-add-education {
  display: block;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 2px dashed #D8746A;
  border-radius: 8px;
  color: #D8746A;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
  margin-bottom: 8px;
}
.btn-add-education:hover {
  background: rgba(216, 116, 106, 0.05);
}
.edu-auto-fill-note {
  font-size: 11px;
  color: #999;
  margin-top: -12px;
  margin-bottom: 16px;
}

/* --- Loading overlay --- */
.form-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.form-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e8e8e8;
  border-top-color: #D8746A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.form-loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

/* --- Responsive --- */
@media (max-width: 599px) {
  .resume-form-section {
    padding: 24px 0 60px;
  }
  .resume-form-section .content-inner {
    padding: 0 16px;
  }
  .form-step {
    padding: 24px 16px;
    border-radius: 8px;
  }
  .resume-form-heading {
    font-size: 16px;
  }
  .resume-form-lead {
    font-size: 13px;
  }
  .form-row--half {
    flex-direction: column;
    gap: 0;
  }
  .form-row--qual {
    flex-direction: column;
    gap: 0;
  }
  /* Step indicator: 5 items in narrow screen */
  .step-indicator {
    gap: 2px;
  }
  .step-indicator-item {
    max-width: none;
  }
  .step-label {
    font-size: 9px;
  }
  .step-num {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .step-indicator-item::after {
    top: 12px;
    left: calc(50% + 12px);
    width: calc(100% - 24px);
  }
  .form-step-title {
    font-size: 16px;
  }
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
  .btn-submit {
    padding: 14px 32px;
  }
  .career-block,
  .edu-block {
    padding: 16px 14px;
  }
  .qualification-remove-btn {
    top: 0;
    right: 0;
  }
}
