/* profile.css — terminal-themed profile page (3 tabs: Certs / Plan / Account).
 * Uses existing CSS variables from styles.css. No new colors invented.
 */

.pf-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
}

.pf-page-head { margin-bottom: 20px; }
.pf-page-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--cyan);
  margin: 0 0 4px;
}
.pf-page-sub {
  color: var(--fg-dim);
  font-size: 13px;
  margin: 0;
}
.pf-mono { font-family: var(--font); }

.pf-not-signed-in {
  text-align: center;
  padding: 60px 20px;
}

/* ───── Tab bar ───── */
.pf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.pf-tabbtn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--fg-dim);
  font: inherit;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 18px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.pf-tabbtn:hover { color: var(--fg-hi); }
.pf-tabbtn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.pf-tab { padding: 4px 0 40px; }
.pf-tab-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.pf-tab-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-hi);
  margin: 0 0 4px;
}
.pf-tab-sub {
  color: var(--fg-dim);
  font-size: 13px;
  margin: 0;
}

/* ───── Empty state ───── */
.pf-empty {
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 40px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
}
.pf-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-hi);
  margin-bottom: 6px;
}
.pf-empty-body {
  color: var(--fg-dim);
  font-size: 13px;
  margin: 0 auto 16px;
  max-width: 440px;
}

/* ───── Cert card list ───── */
.pf-cert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pf-cert-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  padding: 14px 16px;
}
.pf-cert-card-head { margin-bottom: 10px; }
.pf-cert-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pf-cert-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cyan);
  margin: 0;
}
.pf-cert-card-examcode {
  color: var(--fg-mute);
  font-size: 12px;
  margin-top: 2px;
}
.pf-cert-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 18px;
  font-size: 13px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.pf-cert-card-row { display: flex; gap: 8px; align-items: baseline; }
.pf-cert-card-key {
  color: var(--fg-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 80px;
}
.pf-cert-card-val { color: var(--fg); }
.pf-cert-card-rejected .pf-cert-card-val { color: var(--accent-amber, #ffc107); }

.pf-cert-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.pf-cert-card-remove { margin-left: auto; }

.pf-link-btn {
  background: transparent;
  border: 0;
  color: var(--cyan);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.pf-link-btn:hover { color: var(--green); }

/* ───── Verification badges ───── */
.pf-badge {
  display: inline-block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid;
  font-weight: 600;
  white-space: nowrap;
}
.pf-badge-self     { color: var(--fg-mute); border-color: var(--border-hi); background: rgba(255,255,255,0.02); }
.pf-badge-pending  { color: var(--accent-amber, #ffc107); border-color: var(--accent-amber, #ffc107); background: rgba(255,193,7,0.06); }
.pf-badge-verified { color: var(--green); border-color: var(--green); background: rgba(0,255,102,0.06); }
.pf-badge-rejected { color: #ff6b6b; border-color: #ff6b6b; background: rgba(255,107,107,0.06); }

/* ───── Banner / error ───── */
.pf-banner-error {
  background: rgba(255, 107, 107, 0.08);
  border-left: 3px solid #ff6b6b;
  color: #ff9090;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  border-radius: 0 3px 3px 0;
}

/* ───── Modal ───── */
.pf-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pf-fade 120ms ease-out;
}
@keyframes pf-fade { from { opacity: 0; } to { opacity: 1; } }
.pf-modal {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.pf-modal-small { max-width: 420px; }
.pf-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.pf-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cyan);
  margin: 0;
}
.pf-modal-close {
  background: transparent;
  border: 0;
  color: var(--fg-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pf-modal-close:hover { color: var(--fg-hi); }
.pf-modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.pf-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.pf-modal-error {
  background: rgba(255, 107, 107, 0.08);
  border-left: 3px solid #ff6b6b;
  color: #ff9090;
  padding: 10px 12px;
  font-size: 12px;
  margin-top: 12px;
  border-radius: 0 3px 3px 0;
}

/* ───── Form fields inside modal ───── */
.pf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.pf-field-row {
  display: flex;
  gap: 12px;
}
.pf-field-half { flex: 1; }
.pf-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-mute);
  font-weight: 600;
}
.pf-input {
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 9px 11px;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.pf-input:focus {
  outline: none;
  border-color: var(--cyan);
}
.pf-input-file {
  padding: 6px 8px;
  cursor: pointer;
}
.pf-help {
  font-size: 11.5px;
  color: var(--fg-mute);
  line-height: 1.4;
}
.pf-stub-note {
  background: rgba(255, 193, 7, 0.06);
  border-left: 3px solid var(--accent-amber, #ffc107);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--fg-dim);
  border-radius: 0 3px 3px 0;
  margin-top: 4px;
}

/* ───── Account tab ───── */
.pf-account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 20px;
  background: var(--surface);
}
.pf-account-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.pf-account-row:last-child { border-bottom: 0; }
.pf-account-key {
  color: var(--fg-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding-top: 2px;
}
.pf-account-val { color: var(--fg); }

.pf-account-danger {
  margin-top: 32px;
  padding: 18px 20px;
  border: 1px solid #ff6b6b33;
  border-radius: 4px;
  background: rgba(255, 107, 107, 0.04);
}
.pf-danger-title {
  font-size: 14px;
  font-weight: 600;
  color: #ff9090;
  margin: 0 0 6px;
}
.pf-danger-body {
  color: var(--fg-dim);
  font-size: 13px;
  margin: 0 0 12px;
}

/* ───── Buttons (extend existing) ───── */
.btn-danger {
  background: #ff6b6b;
  color: #fff;
  border: 1px solid #ff6b6b;
}
.btn-danger:hover { background: #ff5050; border-color: #ff5050; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

/* ───── Mobile ───── */
@media (max-width: 720px) {
  .pf-page { padding: 0 4px; }
  .pf-page-title { font-size: 20px; }
  .pf-tabbtn { padding: 10px 12px; font-size: 12px; }
  .pf-tab-head { flex-direction: column; align-items: stretch; }
  .pf-tab-head .btn { width: 100%; }
  .pf-cert-card-actions { flex-wrap: wrap; }
  .pf-cert-card-remove { margin-left: 0; }
  .pf-field-row { flex-direction: column; gap: 0; }
  .pf-account-row { grid-template-columns: 1fr; gap: 2px; }
  .pf-modal { max-height: 100vh; height: 100vh; border-radius: 0; }
}
