/* GTEC 외국인 유학생 취업연계 2026 — 공통 스타일 */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-soft: #eff4ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ongoing: #d97706;
  --ongoing-soft: #fff7e6;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
[hidden] { display: none !important; }
.ti { font-size: 1.15em; vertical-align: -0.15em; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 버튼 ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .chip input:focus-visible + span, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 1px;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-lg { min-height: 56px; font-size: 17px; padding: 0 24px; border-radius: 12px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }

/* ── 입력칸 ─────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-weight: 600; font-size: 15px; color: var(--text); }
.field-label .req { color: var(--danger); margin-left: 3px; }
.field-label .en { display: block; font-weight: 400; font-size: 13px; color: var(--text-3); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=month], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 16px;
}
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; padding-right: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input.locked { background: var(--surface-2); color: var(--text-2); }
.other-input { margin-top: 6px; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .field.has-error .chips { border-color: var(--danger); }
.field.has-error .chips { border: 1px solid var(--danger); border-radius: var(--radius-sm); padding: 6px; }
.field-error { color: var(--danger); font-size: 14px; font-weight: 500; }

.checkline { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; cursor: pointer; }
.checkline input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--primary); }
.checkline:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.field-hint { font-size: 13px; color: var(--text-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: 15px; cursor: pointer; user-select: none;
}
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip span small { margin-left: 6px; font-size: 12px; font-weight: 500; opacity: .75; }

/* ── 사진 ───────────────────────────── */
.photo-box { display: flex; align-items: center; gap: 16px; }
.photo-preview {
  width: 96px; height: 120px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  display: grid; place-items: center; color: var(--text-3);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .ti { font-size: 32px; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-hint { font-size: 13px; color: var(--text-3); }

/* ── 단독 등록 화면 ──────────────────── */
.solo-top {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
  color: #fff; padding: 28px 16px 72px;
}
.solo-top .inner { max-width: 760px; margin: 0 auto; }
.solo-top .org { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,.92); }
.org-mark { width: 36px; height: 36px; flex: none; padding: 4px; border-radius: 10px; background: #fff; object-fit: contain; }
.solo-top h1 { margin: 6px 0 4px; font-size: 26px; line-height: 1.3; letter-spacing: -0.02em; }
.solo-top p { margin: 0; opacity: .9; font-size: 15px; }
.solo-main { max-width: 760px; margin: -48px auto 40px; padding: 0 16px; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.panel + .panel { margin-top: 16px; }
.panel-title { margin: 0 0 4px; font-size: 18px; }
.panel-sub { margin: 0 0 20px; font-size: 14px; color: var(--text-3); }
.notice { background: var(--primary-soft); color: var(--primary-dark); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.consent { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; cursor: pointer; }
.consent input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }
.submit-bar { margin-top: 24px; }
.solo-foot { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 20px; }
.done-box { text-align: center; padding: 48px 24px; }
.done-box > .ti { font-size: 64px; color: var(--success); }
.done-box h2 { margin: 12px 0 8px; }
.done-box p { color: var(--text-2); margin: 0 0 24px; }
/* 위 두 버튼을 합친 폭 = 아래 버튼 폭 */
.done-actions { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 100%; }
.done-actions .wide { grid-column: 1 / -1; }
.done-actions .btn { min-height: 56px; padding: 6px 16px; text-align: left; }
.done-actions .btn > span { display: flex; flex-direction: column; line-height: 1.3; }
.done-actions .btn small { font-size: 12px; font-weight: 500; opacity: .75; }
@media (max-width: 640px) {
  .done-actions { display: grid; width: 100%; }
  .done-actions .btn { padding: 6px 10px; }
}
.done-box .done-hint { margin: 14px 0 0; font-size: 14px; color: var(--text-3); }
.done-box .done-hint:empty { display: none; }
.mine-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 16px 20px; font-weight: 600; }
.school-box { margin-bottom: 18px; }
.school-box #school-name { margin-top: 4px; }
.mine-open-row { display: flex; gap: 8px; flex: 1 1 260px; max-width: 360px; }
.mine-open-row input { min-width: 0; }
.edit-note { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; padding: 16px 20px; background: var(--primary-soft); color: var(--primary-dark); font-size: 15px; }
/* 이력서 PDF 만드는 동안 */
.busy-cover { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(15, 23, 42, .45); color: #fff; font-weight: 700; font-size: 18px; }

/* ── 첫 화면 ────────────────────────── */
.home-cards { display: grid; gap: 14px; }
.home-card {
  display: flex; align-items: center; gap: 16px; padding: 22px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); border: 1px solid transparent;
  transition: border-color .15s, transform .15s;
}
.home-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.home-card .icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 28px; }
.home-card .icon .ti { font-size: 28px; }
.home-card h2 { margin: 0; font-size: 19px; }
.home-card p { margin: 2px 0 0; color: var(--text-3); font-size: 14px; }
.home-card .arrow { margin-left: auto; color: var(--text-3); font-size: 22px; }

/* ── 알림 ───────────────────────────── */
#toast-box { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; transition: opacity .3s, transform .3s; }
.toast-err { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ── 배지 ───────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; line-height: 1.6; }
.badge-new { background: var(--danger); color: #fff; }
.badge-ongoing { background: var(--ongoing-soft); color: #b45309; border: 1px solid #fcd9a0; }
.badge-success { background: var(--success-soft); color: var(--success); border: 1px solid #a7e3bd; }
.badge-gray { background: #f1f5f9; color: var(--text-2); }
.badge-blue { background: var(--primary-soft); color: var(--primary); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .panel { padding: 20px 16px; }
  .solo-top { padding: 22px 16px 64px; }
  .solo-top h1 { font-size: 22px; }
}
