/* pages/profile.css — trang Hồ sơ (templates/pages/profile.html + profile/_*.html). Tiền tố prof2-. */

.crumb-link { color: var(--muted); text-decoration: none; }
.crumb-link:hover { color: var(--accent); }

/* Tổng quan */
.callout { padding: 16px 18px; }
.prof2-callout-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--r-md);
  background: var(--bg); color: var(--accent); display: grid; place-items: center;
}
.prof2-callout-text { flex-grow: 1; min-width: 0; }
.prof2-callout-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.prof2-callout-sub { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--text); }
.callout .btn { font-size: 14px; flex-shrink: 0; }

.prof2-stat {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.prof2-stat-name { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.prof2-stat-value { font-size: 22px; font-weight: 700; color: var(--ink); }

.prof2-links { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.prof2-link {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px;
  text-decoration: none; color: var(--faint);
}
.prof2-link + .prof2-link { border-top: 1px solid var(--line); }
.prof2-link:hover { background: var(--bg-soft); color: var(--muted); }
.prof2-link-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--r-md);
  background: var(--bg-soft); color: var(--muted); display: grid; place-items: center;
}
.prof2-link-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prof2-link-text b { font-size: 15px; font-weight: 600; color: var(--ink); }
.prof2-link-text span { font-size: 13px; line-height: 1.45; color: var(--muted); }
.prof2-logout { margin-top: 24px; }
.prof2-btn-danger { color: var(--red); border-color: var(--red-bg); font-size: 14px; }
.prof2-btn-danger:hover { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.prof2-guest-note { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 13px; color: var(--muted); }

/* Màn con (không ảnh bìa) */
.prof2-sub { max-width: 820px; }
.prof2-sub-icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin-top: 36px;
  border-radius: 10px; background: var(--bg-soft); color: var(--muted);
}
.prof2-sub-title { margin-top: 14px; }

.prof2-form { display: block; }
.prof2-fields { display: flex; flex-direction: column; gap: 18px; }
.prof2-fields + .prof2-fields { margin-top: 18px; }
.prof2-cols-2, .prof2-cols-3 { display: grid; gap: 16px; }
.prof2-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prof2-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prof2-form .prof2-cols-2 + .prof2-cols-3, .prof2-cols-3 + .prof2-field { margin-top: 18px; }
.prof2-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prof2-field label, .prof2-label, .prof2-fieldset legend { font-size: 13px; font-weight: 500; color: var(--muted); }
.prof2-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.prof2-fieldset legend { margin-bottom: 6px; padding: 0; }
.prof2-input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg);
  font: inherit; font-size: 14px; color: var(--ink);
}
.prof2-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.prof2-input[readonly] { background: var(--bg-side); color: var(--muted); }
.prof2-input.is-invalid { border-color: var(--red); }
.prof2-select { position: relative; }
.prof2-select select { appearance: none; -webkit-appearance: none; padding-right: 36px; }
.prof2-select .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.prof2-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--faint); }
.prof2-field .prof2-hint { margin-top: 0; }

.prof2-group {
  margin: 30px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font-size: 16px; font-weight: 600; color: var(--ink);
}
.prof2-group-tight { margin-bottom: 4px; }
.prof2-group-lead { margin: 6px 0 14px; font-size: 13px; color: var(--muted); }

/* Ô chọn dạng thẻ (ngôn ngữ đang học) */
.prof2-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.prof2-choice {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); cursor: pointer;
}
.prof2-choice input, .prof2-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.prof2-choice-text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prof2-choice-text b { font-size: 15px; font-weight: 600; color: var(--ink); }
.prof2-choice-text span { font-size: 12px; color: var(--muted); }
.prof2-radio {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 1.5px solid var(--faint); display: grid; place-items: center; color: transparent;
}
.prof2-choice:has(input:checked) { border: 1.5px solid var(--accent); background: var(--callout); }
.prof2-choice:has(input:checked) .prof2-radio { border: 0; background: var(--accent); color: var(--on-accent); }
.prof2-choice:has(input:focus-visible), .prof2-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Nút chọn liền nhau (cấp độ, ngôn ngữ giao diện) */
.prof2-seg { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--bg-soft); }
.prof2-seg button {
  flex: 1 1 0; min-width: 0; height: 32px; padding: 0 10px; border: 0; border-radius: 5px;
  background: none; font-size: 14px; color: var(--muted); cursor: pointer;
}
.prof2-seg button:hover { color: var(--ink); }
.prof2-seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }

/* Hộp liệt kê (lớp — chỉ đọc; ô tích ngôn ngữ ghi chú) */
.prof2-box { border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.prof2-class {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px;
  border-radius: var(--r); color: var(--ink); text-decoration: none;
}
.prof2-class:hover { background: var(--bg-soft); color: var(--ink); }
.prof2-class .icon { color: var(--muted); }
.prof2-class-name { flex-grow: 1; min-width: 0; font-size: 14px; }
.prof2-class-empty { margin: 0; padding: 8px 10px; font-size: 14px; color: var(--muted); }
.prof2-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.prof2-check {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px;
  border-radius: var(--r); font-size: 14px; color: var(--ink); cursor: pointer;
}
.prof2-check:hover { background: var(--bg-soft); }
.prof2-checkbox {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: var(--r-sm);
  border: 1.5px solid var(--faint); background: var(--bg); color: transparent; display: grid; place-items: center;
}
.prof2-check:has(input:checked) .prof2-checkbox { border: 0; background: var(--accent); color: var(--on-accent); }

/* Hàng nút lưu */
.prof2-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line);
}
.prof2-actions-plain { margin-top: 0; padding-top: 0; border-top: 0; }
.btn-md { height: 40px; font-size: 14px; }
.prof2-msg { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.prof2-msg.is-ok { color: var(--green); }
.prof2-msg.is-error { color: var(--red); }

/* Bảo mật */
.prof2-pw-form { max-width: 420px; }
.prof2-pw { position: relative; }
.prof2-pw .prof2-input { padding-right: 44px; }
.prof2-eye {
  width: 36px; height: 34px; border: 0; border-radius: var(--r); background: none;
  color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.prof2-eye:hover { background: var(--bg-soft); color: var(--ink); }
.prof2-pw .prof2-eye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.prof2-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.prof2-row-text { flex-grow: 1; min-width: 0; }
.prof2-row-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.prof2-row-sub { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.prof2-row .btn { flex-shrink: 0; }
.prof2-danger-zone { margin-top: 30px; padding: 4px 16px; border: 1px solid var(--red-bg); border-radius: var(--r-md); }
.prof2-danger-text { color: var(--red); }
.prof2-icon-danger { background: var(--red-bg); color: var(--red); }

/* Hộp xoá tài khoản */
.prof2-dialog {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 12px;
  box-shadow: var(--shadow-pop); color: var(--ink);
}
.prof2-dialog::backdrop { background: rgba(15, 23, 42, 0.42); }
.prof2-dialog-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 8px; }
.prof2-dialog-title { flex-grow: 1; margin: 0; font-size: 20px; font-weight: 700; }
.prof2-dialog-body { padding: 12px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.prof2-dialog-text { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); }
.prof2-delete-list {
  margin: 0 0 8px; padding: 12px 14px; list-style: none; display: flex; flex-direction: column; gap: 8px;
  border-radius: var(--r-md); background: var(--red-bg);
}
.prof2-delete-list li { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--text); }
.prof2-delete-list .icon { color: var(--red); margin-top: 2px; }
.prof2-field-error { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--red); }
.prof2-field-error[hidden] { display: none; }
.prof2-dialog-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px;
  border-top: 1px solid var(--line); background: var(--bg-side);
}

@media (max-width: 860px) {
  .prop-name { width: auto; min-width: 116px; margin-right: 8px; }  /* nhãn dài không đè lên giá trị */
  .prof2-sub-icon { margin-top: 20px; }
  .prof2-cols-2, .prof2-cols-3 { grid-template-columns: minmax(0, 1fr); }
  .prof2-choices, .prof2-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prof2-link { padding: 12px; }
  .prof2-row { flex-wrap: wrap; }
  .prof2-row .btn { margin-left: 50px; }
  .prof2-seg { flex-wrap: wrap; }
  .btn-md, .prof2-input { height: 44px; }
  .prof2-dialog-foot { flex-direction: column-reverse; }
  .prof2-dialog-foot .btn { width: 100%; }
}
