/* =========================================
   DFL Account Pages (PMPro + Saved + Support)
   Scope: Account-related screens
   ========================================= */

:where(
  #pmpro_order_list .pmpro_card,
  #pmpro_order_single .pmpro_card,
  #pmpro_cancel .pmpro_card,
  #pmpro_cancel form#pmpro_form.pmpro_card,
  #pmpro_member_profile_edit .pmpro_card
){
  background: var(--dfl-card-bg, #fff);
  border: 1px solid var(--dfl-card-bd, rgba(0,0,0,.08));
  border-radius: var(--dfl-radius, 12px);
  box-shadow: var(--dfl-card-shadow, 0 6px 18px rgba(0,0,0,.06));
}

:where(
  #pmpro_order_list .pmpro_card_content,
  #pmpro_order_single .pmpro_card_content,
  #pmpro_cancel .pmpro_card_content,
  #pmpro_cancel form#pmpro_form .pmpro_card_content,
  #pmpro_member_profile_edit .pmpro_card_content
){
  padding: clamp(16px, 2vw, 24px);
}

:where(
  #pmpro_order_list .pmpro_tag.pmpro_tag-success,
  #pmpro_order_single .pmpro_tag.pmpro_tag-success
){
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: rgba(46,204,113,.15);
  color: #27AE60;
  border: 1px solid rgba(46,204,113,.35);
}

/* Profile & Cancel buttons: match account button size/design (body class fallback if PMPro wrapper ID differs) */
:where(
  #pmpro_cancel form#pmpro_form .pmpro_btn.pmpro_btn-cancel,
  #pmpro_member_profile_edit .pmpro_btn.pmpro_btn-cancel,
  body.page-your-profile .pmpro_btn.pmpro_btn-cancel
){
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  background: #fff;
  color: var(--dfl-link, #2980B9);
  border: 1px solid rgba(0,0,0,.14);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}

:where(
  #pmpro_cancel form#pmpro_form .pmpro_btn.pmpro_btn-cancel:hover,
  #pmpro_member_profile_edit .pmpro_btn.pmpro_btn-cancel:hover,
  body.page-your-profile .pmpro_btn.pmpro_btn-cancel:hover
){
  transform: translateY(-1px);
  background: rgba(41,128,185,.08);
  border-color: rgba(41,128,185,.35);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

:where(
  #pmpro_cancel form#pmpro_form .pmpro_btn.pmpro_btn-submit,
  #pmpro_member_profile_edit .pmpro_btn.pmpro_btn-submit-update-profile,
  body.page-your-profile .pmpro_btn.pmpro_btn-submit-update-profile
){
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  background: var(--dfl-accent, #E74C3C);
  color: #fff;
  border: 1px solid rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

:where(
  #pmpro_cancel form#pmpro_form .pmpro_btn.pmpro_btn-submit:hover,
  #pmpro_member_profile_edit .pmpro_btn.pmpro_btn-submit-update-profile:hover,
  body.page-your-profile .pmpro_btn.pmpro_btn-submit-update-profile:hover
){
  transform: translateY(-1px);
  background: rgba(231,76,60,.92);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

/* Force profile form buttons to match account design (overrides PMPro frontend.css) */
.pmpro_form_submit .pmpro_btn {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  min-height: unset !important;
}
.pmpro_form_submit .pmpro_btn.pmpro_btn-cancel,
.pmpro_form_submit a.pmpro_btn {
  background: #fff !important;
  color: var(--dfl-link, #2980B9) !important;
  border: 1px solid rgba(0,0,0,.14) !important;
}
.pmpro_form_submit .pmpro_btn.pmpro_btn-cancel:hover,
.pmpro_form_submit a.pmpro_btn:hover {
  background: rgba(41,128,185,.08) !important;
  border-color: rgba(41,128,185,.35) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.12) !important;
}
.pmpro_form_submit .pmpro_btn.pmpro_btn-submit-update-profile,
.pmpro_form_submit .pmpro_btn.pmpro_btn-submit,
.pmpro_form_submit input[type="submit"].pmpro_btn {
  background: var(--dfl-accent, #E74C3C) !important;
  color: #fff !important;
  border: 1px solid rgba(0,0,0,.12) !important;
}
.pmpro_form_submit .pmpro_btn.pmpro_btn-submit-update-profile:hover,
.pmpro_form_submit .pmpro_btn.pmpro_btn-submit:hover,
.pmpro_form_submit input[type="submit"].pmpro_btn:hover {
  background: rgba(231,76,60,.92) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.12) !important;
}

#pmpro_cancel .pmpro_table_cancel-action a{
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  background: #fff;
  color: var(--dfl-accent, #E74C3C);
  border: 1px solid rgba(231,76,60,.40);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}

#pmpro_cancel .pmpro_table_cancel-action a:hover{
  transform: translateY(-1px);
  background: rgba(231,76,60,.08);
  border-color: rgba(231,76,60,.55);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

#pmpro_order_list{ padding-top: 40px; }
#pmpro_order_list .pmpro_section_title{ font-size: 28px; font-weight: 600; margin: 0 0 16px; }
#pmpro_order_list .pmpro_table{ width: 100%; border-collapse: collapse; }
#pmpro_order_list .pmpro_table thead th{ font-weight: 600; color: #333; font-size: 13px; padding: 12px 10px; border-bottom: 1px solid rgba(0,0,0,.08); }
#pmpro_order_list .pmpro_table tbody th,#pmpro_order_list .pmpro_table tbody td{ padding: 12px 10px; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: middle; font-size: 14px; }
#pmpro_order_list .pmpro_table tbody tr:last-child th,#pmpro_order_list .pmpro_table tbody tr:last-child td{ border-bottom: none; }
#pmpro_order_list .pmpro_table a{ color: var(--dfl-link, #2980B9); text-decoration: none; }
#pmpro_order_list .pmpro_table a:hover{ text-decoration: underline; }

#pmpro_order_single{ padding-top: 40px; }
#pmpro_order_single .pmpro_card_actions{ padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 12px; opacity: .8; }
#pmpro_order_single h2.pmpro_card_title{ margin: 0 0 14px; font-size: 28px; font-weight: 600; }
#pmpro_order_single table{ width: 100%; border-collapse: collapse; margin-top: 14px; }
#pmpro_order_single thead th{ font-size: 13px; font-weight: 600; color: #333; padding: 12px 10px; border-bottom: 1px solid rgba(0,0,0,.08); }
#pmpro_order_single tbody td,#pmpro_order_single tbody th{ padding: 12px 10px; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 14px; }
#pmpro_order_single a{ color: var(--dfl-link, #2980B9); text-decoration: none; }
#pmpro_order_single a:hover{ text-decoration: underline; }

#pmpro_cancel{ margin-top: 40px; }
#pmpro_cancel .pmpro_card_title{ margin: 0; padding: clamp(16px, 2vw, 24px); padding-bottom: 10px; font-size: 24px; font-weight: 600; }
#pmpro_cancel .pmpro_card_content{ padding: clamp(16px, 2vw, 24px); }
#pmpro_cancel .pmpro_card_content > p{ margin: 0 0 12px; font-size: 14px; opacity: .8; }
#pmpro_cancel .pmpro_table{ width: 100%; border-collapse: collapse; }
#pmpro_cancel .pmpro_table thead th{ font-weight: 600; color: #333; font-size: 13px; padding: 12px 10px; border-bottom: 1px solid rgba(0,0,0,.08); }
#pmpro_cancel .pmpro_table tbody th,#pmpro_cancel .pmpro_table tbody td{ padding: 12px 10px; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: middle; font-size: 14px; }
#pmpro_cancel .pmpro_table tbody tr:last-child th,#pmpro_cancel .pmpro_table tbody tr:last-child td{ border-bottom: none; }
#pmpro_cancel .pmpro_actions_nav{ margin-top: 14px; font-size: 14px; }
#pmpro_cancel .pmpro_actions_nav a{ color: var(--dfl-link, #2980B9); text-decoration: none; }
#pmpro_cancel .pmpro_actions_nav a:hover{ text-decoration: underline; }

#pmpro_cancel form#pmpro_form.pmpro_card{ overflow: hidden; }
#pmpro_cancel form#pmpro_form .pmpro_card_content > p:first-child{ margin: 0 0 10px; font-size: 18px; font-weight: 600; }
#pmpro_cancel form#pmpro_form .pmpro_card_content > p:nth-child(2){ margin: 0 0 14px; font-size: 14px; color: #333; opacity: .85; }
#pmpro_cancel form#pmpro_form .pmpro_form_submit{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,.06); }
#pmpro_cancel form.pmpro_form{ margin-top: 8px; }

/* Your Profile: back link and actions (tie into account flow) */
.dfl-profile-back {
  margin: 0 0 12px;
  padding-top: var(--dfl-account-top-space, 40px);
  font-size: 14px;
}
.dfl-profile-back__link {
  color: var(--dfl-link, #2980B9);
  text-decoration: none;
  font-weight: 500;
}
.dfl-profile-back__link:hover {
  text-decoration: underline;
}
.dfl-profile-actions {
  margin-top: 14px;
  margin-bottom: 24px;
}
.dfl-profile-actions .dfl-dash-btn.dfl-btn {
  display: inline-flex;
}

#pmpro_member_profile_edit{ padding-top: 0; }
#pmpro_member_profile_edit .pmpro_card{ overflow: hidden; }
#pmpro_member_profile_edit .pmpro_form_heading{ margin: 0 0 12px; font-size: 24px; font-weight: 600; color: #111; }
#pmpro_member_profile_edit .pmpro_form_fields{ gap: 12px; }
#pmpro_member_profile_edit .pmpro_form_label{ display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #333; }
#pmpro_member_profile_edit .pmpro_form_input{ width: 100%; border-radius: 12px; border: 1px solid rgba(0,0,0,.14); padding: 10px 12px; font-size: 14px; background: #fff; box-shadow: none; }
#pmpro_member_profile_edit .pmpro_form_input:focus{ outline: none; border-color: rgba(41,128,185,.45); box-shadow: 0 0 0 3px rgba(41,128,185,.12); }
#pmpro_member_profile_edit input[readonly]{ background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.10); color: rgba(0,0,0,.70); }
#pmpro_member_profile_edit .pmpro_form_hint{ margin: 8px 0 0; font-size: 13px; color: rgba(0,0,0,.65); }
#pmpro_member_profile_edit .pmpro_form_submit{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(0,0,0,.06); }

.saved-articles-wrap{ padding-top: var(--dfl-account-top-space, 40px); }
.saved-article .bookmark-btn:hover{ transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.saved-article .meta{ opacity: .8; }

/* Tablet: 1024 */
@media (max-width: 1024px) {
  #pmpro_order_list,
  #pmpro_order_single,
  #pmpro_cancel,
  #pmpro_member_profile_edit {
    padding-top: 24px;
  }

  :where(
    #pmpro_order_list .pmpro_card_content,
    #pmpro_order_single .pmpro_card_content,
    #pmpro_cancel .pmpro_card_content,
    #pmpro_cancel form#pmpro_form .pmpro_card_content,
    #pmpro_member_profile_edit .pmpro_card_content
  ) {
    padding: clamp(14px, 2vw, 20px);
  }
}

/* Mobile: 768 – tables scroll, no overflow */
@media (max-width: 768px) {
  #pmpro_order_list,
  #pmpro_order_single,
  #pmpro_cancel,
  #pmpro_member_profile_edit {
    padding-top: 16px;
  }

  #pmpro_order_list .pmpro_card_content,
  #pmpro_order_single .pmpro_card_content,
  #pmpro_cancel .pmpro_card_content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #pmpro_order_list .pmpro_table,
  #pmpro_order_single .pmpro_table,
  #pmpro_order_single table,
  #pmpro_cancel .pmpro_table {
    min-width: 480px;
  }

  #pmpro_cancel .pmpro_card_content,
  #pmpro_cancel form#pmpro_form .pmpro_card_content {
    padding: 16px;
  }

  #pmpro_cancel .pmpro_card_title {
    padding: 16px 16px 10px;
  }

  #pmpro_cancel form#pmpro_form .pmpro_form_submit,
  #pmpro_member_profile_edit .pmpro_form_submit {
    flex-direction: column;
  }

  #pmpro_cancel form#pmpro_form .pmpro_form_submit .pmpro_btn,
  #pmpro_member_profile_edit .pmpro_form_submit .pmpro_btn {
    width: 100%;
  }
}
