/* Profile form. Depends on base.css tokens. */

.profile {
  padding: calc(var(--nav-height) + 36px) 0 72px;
}

.profile__inner {
  max-width: 760px;
}

.profile__head {
  margin-bottom: 28px;
}

.profile__title {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.profile__lede {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.profile__form {
  display: grid;
  gap: 18px;
}

/* Plan and billing */

.planbox {
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.planbox__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.planbox__text {
  min-width: 0;
}

/* Same size as the Master CV heading under it: two cards, one weight. */
.planbox__name {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.planbox__meta {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.planbox__held {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* Master CV ------------------------------------------------------------- */

.mastercv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 18px;
  padding: 18px 20px;
  margin-bottom: 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.mastercv__text {
  min-width: 0;
}

.mastercv__title {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.mastercv__meta,
.mastercv__file {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.mastercv__file {
  color: var(--text);
  font-weight: 500;
}

.mastercv__button {
  cursor: pointer;
}

.mastercv__status {
  grid-column: 1 / -1;
  min-height: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.mastercv__status:not(:empty) {
  margin-top: 8px;
}

.pgroup {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.pgroup__legend {
  padding: 0 8px;
  margin-left: -8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pgroup__hint {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/*
 * One gap value everywhere in the form: between two columns, between two rows,
 * and between two stacked blocks below. Anything else reads as a near miss.
 */
.pgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pfield {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pfield--wide,
.pfield--block {
  grid-column: 1 / -1;
}

.pfield--block + .pfield--block {
  margin-top: 14px;
}

.pfield__label {
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
}

.pfield__hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/*
 * Boxes on this page carry a CV, not a checkout form, so the type is the size
 * it is in the document boxes on the composer. The horizontal padding matches
 * the textareas below to the pixel: every value the user typed starts on one
 * vertical line down the whole form, whatever shape of box holds it.
 */
.pfield .input {
  height: 40px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* Chrome draws mm/dd/yyyy at full strength; it is a placeholder, so mute it. */
.pfield .input[type="date"]:not(:focus):invalid,
.pfield .input[type="date"]:not(:focus):placeholder-shown {
  color: var(--text-muted);
}

/*
 * These hold whole sections lifted out of a CV, not a sentence someone types,
 * so they are set like the document boxes on the composer: smaller type, open
 * leading, and room at the edges. A parsed CV is read here more than written.
 */
.textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

/* A quiet bar, so a long parsed section does not gain a grey slab down its side. */
.textarea::-webkit-scrollbar {
  width: 10px;
}

.textarea::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  background-clip: content-box;
}

.textarea::-webkit-scrollbar-track {
  background: transparent;
}

.textarea::placeholder {
  color: var(--text-muted);
}

.textarea:focus {
  outline: none;
  border-color: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(22, 22, 26, 0.04);
}

.profile__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.profile__status {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .profile {
    padding: calc(var(--nav-height) + 24px) 0 56px;
  }

  .profile__head {
    margin-bottom: 22px;
  }

  .profile__title {
    font-size: 24px;
  }

  .pgroup {
    padding: 18px 16px;
  }

  .pfield .input,
  .textarea {
    font-size: 16px;
  }

  .pfield .input {
    height: 46px;
  }

  /* Saving is the whole point of the page, so it gets the full width. */
  .profile__actions .btn--primary {
    flex: 1 0 100%;
  }
}

@media (max-width: 640px) {
  .mastercv {
    grid-template-columns: 1fr;
  }

  .mastercv__button {
    justify-self: start;
    margin-top: 8px;
  }

  .pgrid {
    grid-template-columns: 1fr;
  }
}
