/* Profile page — sits on top of home.css and uses its tokens
   (--tile, --tile-border, --text, --text-dim, --accent, --coral). */

.pf-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}
.pf-page .hidden { display: none !important; }

.pf-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.pf-avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet) 55%, var(--coral));
  text-transform: uppercase;
}
.pf-head-text { min-width: 0; }
.pf-head h1 {
  font-size: 28px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.pf-sub {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.pf-faint { color: var(--text-faint); font-size: 13px; margin-top: 2px; }

.pf-card {
  background: #fff;
  border: 1px solid var(--tile-border);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04), 0 8px 24px rgba(29, 29, 31, 0.04);
}
.pf-card h1 { font-size: 24px; margin-bottom: 8px; }
.pf-card h2 {
  font-size: 18px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pf-center { text-align: center; padding: 40px 24px; }
.pf-lead {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.pf-callout {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.02));
}

.pf-form { display: block; }
.pf-field { margin-bottom: 14px; }
.pf-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.pf-field input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS Safari zooming the page when a field is focused */
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--tile-border);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pf-field input:hover { border-color: #cfcfd6; }
.pf-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.pf-field input[aria-invalid="true"] { border-color: var(--coral); }
.pf-hint { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.pf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin-bottom: 14px;
  cursor: pointer;
}
.pf-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pf-actions-center { justify-content: center; }
.pf-actions .btn { cursor: pointer; border: 0; font-family: inherit; }
.pf-actions .btn:disabled { opacity: 0.55; cursor: default; }
.pf-actions .btn-primary { padding: 12px 22px; }
.pf-actions .btn-ghost { padding: 12px 18px; }
a.btn { cursor: pointer; }

.pf-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 980px;
  background: var(--tile);
  color: var(--text-dim);
  vertical-align: middle;
}
.pf-tag:empty { display: none; }
.pf-tag.ok { background: rgba(10, 150, 90, 0.12); color: #08794a; }
.pf-tag.warn { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

.pf-msg {
  display: none;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.pf-msg.show { display: block; }
.pf-msg.ok { background: rgba(10, 150, 90, 0.1); color: #08794a; border: 1px solid rgba(10, 150, 90, 0.3); }
.pf-msg.err { background: rgba(220, 38, 38, 0.08); color: #b91c1c; border: 1px solid rgba(220, 38, 38, 0.3); }

.pf-devices { list-style: none; margin: 0 0 16px; padding: 0; }
.pf-devices li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--tile-border);
  font-size: 14px;
}
.pf-devices li:first-child { border-top: 0; }
.pf-device-name { font-weight: 600; }
.pf-device-meta { color: var(--text-dim); font-size: 13px; }

.pf-danger {
  margin-top: 18px;
  border-top: 1px solid var(--tile-border);
  padding-top: 14px;
}
.pf-danger summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #b91c1c;
  margin-bottom: 12px;
}
.pf-btn-danger { background: #dc2626; color: #fff; padding: 12px 20px; }
.pf-btn-danger:hover:not(:disabled) { background: #b91c1c; }

@media (max-width: 520px) {
  .pf-page { padding: 24px 14px 56px; }
  .pf-card { padding: 20px 16px; border-radius: 16px; }
  .pf-head h1 { font-size: 24px; }
  .pf-avatar { width: 54px; height: 54px; font-size: 22px; }
  .pf-actions .btn { width: 100%; }
  .pf-devices li { flex-direction: column; align-items: flex-start; gap: 4px; }
}
