/* ============================================
   PMPro frontend overrides for doctorside
   ============================================ */

/* --- 1. 見出しを常識的なサイズに --- */
.pmpro_form h1,
.pmpro_form .pmpro_heading,
body.pmpro-checkout h1,
body.pmpro-login h1,
body.pmpro-account h1,
.pmpro_login_wrap h1 {
  font-size: 1.75rem !important;
  line-height: 1.4;
  margin: 0 0 1.5rem;
  font-weight: 700;
}

/* サブ見出し（アカウント情報など） */
.pmpro_form h2,
.pmpro_form h3,
.pmpro_form legend {
  font-size: 1.1rem !important;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

/* --- 2. ラベルを上に積む（モバイル必須） --- */
.pmpro_form .pmpro_form_field,
.pmpro_form .pmpro_checkout-field,
.pmpro_form_field-password,
.pmpro_form_field-password2,
.pmpro_form_field-bemail,
.pmpro_form_field-bconfirmemail {
  display: block !important;
  width: 100% !important;
  margin-bottom: 1rem;
}

.pmpro_form label {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
}

/* PMProのテーブル状レイアウトを潰す */
.pmpro_form .pmpro_form_field > label,
.pmpro_form .pmpro_checkout-field > label {
  float: none !important;
}

/* --- 3. 入力欄をしっかり見せる --- */
.pmpro_form input[type="text"],
.pmpro_form input[type="email"],
.pmpro_form input[type="password"],
.pmpro_form input[type="tel"],
.pmpro_form input[type="number"],
.pmpro_form select,
.pmpro_form textarea,
.pmpro_form .input {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.75rem 0.9rem !important;
  font-size: 16px !important; /* iOS自動ズーム防止 */
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  background: #fff !important;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.pmpro_form input:focus,
.pmpro_form select:focus,
.pmpro_form textarea:focus {
  outline: none !important;
  border-color: #1a2540 !important;
  box-shadow: 0 0 0 3px rgba(26, 37, 64, 0.1) !important;
}

/* --- 4. ボタンをdoctorsideネイビーに統一 --- */
.pmpro_form .pmpro_btn,
.pmpro_form input[type="submit"],
.pmpro_btn-submit-checkout,
.pmpro_btn-submit-login,
.pmpro_login_wrap input[type="submit"] {
  background: #1a2540 !important; /* ←ヘッダーのCTAカラーに合わせて調整 */
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important; /* 丸いCTAに合わせる */
  padding: 0.85rem 2rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  width: 100%;
  max-width: 320px;
}

.pmpro_form .pmpro_btn:hover,
.pmpro_form input[type="submit"]:hover {
  background: #0f1830 !important;
}

.pmpro_form .pmpro_btn:active {
  transform: translateY(1px);
}

/* --- 5. Show Password / リンク類を整える --- */
.pmpro_password-toggle {
  font-size: 0.85rem !important;
  color: #6b7280 !important;
  margin: 0.4rem 0 1rem;
}

.pmpro_form a {
  color: #1a2540;
  text-decoration: underline;
}

/* --- 6. 全体の余白・幅 --- */
.pmpro_form,
.pmpro_login_wrap,
.pmpro_checkout {
  max-width: 480px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

/* --- 7. PMProデフォルトのカード装飾を消す --- */
.pmpro_card,
.pmpro_form .pmpro_card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* --- 8. チェックボックス（ログイン状態を保存する） --- */
.pmpro_form input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #1a2540;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* ============================================
   修正パッチ（既存CSS の末尾に追加）
   ============================================ */

/* --- 1. Show Password を小さいテキストリンクに戻す --- */
.pmpro_password-toggle,
button.pmpro_password-toggle,
a.pmpro_password-toggle,
.pmpro_form .pmpro_password-toggle,
.pmpro_form button.pmpro_password-toggle {
  background: none !important;
  background-color: transparent !important;
  color: #6b7280 !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.25rem 0 !important;
  margin: 0.4rem 0 1rem !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  text-align: left !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.3rem;
  box-shadow: none !important;
}

.pmpro_password-toggle:hover {
  background: none !important;
  color: #1a2540 !important;
  text-decoration: underline;
}

.pmpro_password-toggle svg,
.pmpro_password-toggle .dashicons {
  width: 16px !important;
  height: 16px !important;
  fill: currentColor;
}

/* --- 2. fieldset / hr の余計な線を全部消す --- */
.pmpro_form fieldset,
.pmpro_form .pmpro_fieldset,
.pmpro_form .pmpro_form_fields {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
}

.pmpro_form hr {
  display: none !important;
}

/* --- 3. 「ここでログイン」の改行を防ぐ --- */
.pmpro_form a,
.pmpro_login_wrap a {
  white-space: nowrap;
  display: inline-block;
}


/* リンクを含む親段落は改行を許容するけど、リンク内は割らない */
.pmpro_form p {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* --- 4. H1「新規会員登録」をさらに抑える --- */
h1.entry-title,
.pmpro_form h1,
body.pmpro-checkout h1,
body.pmpro-login h1,
body.pmpro-account h1,
.pmpro_login_wrap h1 {
  font-size: 1.5rem !important;
  line-height: 1.4 !important;
  margin: 1rem 0 1.25rem !important;
  font-weight: 700;
}

/* --- 5. サブ見出し「アカウント情報」を整える（下線なしで小さく） --- */
.pmpro_form h2,
.pmpro_form h3,
.pmpro_form legend,
.pmpro_form .pmpro_form_legend {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #6b7280 !important;
  letter-spacing: 0.04em;
  text-transform: none;
  border: none !important;
  padding: 0 !important;
  margin: 1.75rem 0 0.75rem !important;
}

/* --- 6. 必須アスタリスクを控えめに --- */
.pmpro_asterisk,
.pmpro_required,
.pmpro_form label .pmpro_asterisk,
.pmpro_form .required {
  color: #d1456b !important;
  font-weight: 400 !important;
  font-size: 0.85em;
  margin-left: 0.15em;
}

/* --- 7. ボタン幅をモバイルでもう少しコンパクトに（任意） --- */
.pmpro_form .pmpro_btn-submit-checkout,
.pmpro_form input[type="submit"] {
  max-width: 100% !important; /* フル幅を維持したい場合はそのまま */
}

/* ============================================
   最終調整パッチ
   ============================================ */

/* --- 1. ボタン幅指定を「送信ボタンだけ」に限定 --- */
/* .pmpro_btn 全般に幅をかけたのを巻き戻す */
.pmpro_form .pmpro_btn,
.pmpro_form button.pmpro_btn {
  width: auto !important;
  max-width: none !important;
  display: inline-flex !important;
}

/* 送信系ボタンだけフル幅にする */
.pmpro_form input[type="submit"],
.pmpro_form button[type="submit"],
.pmpro_btn-submit-checkout,
.pmpro_btn-submit-login,
.pmpro_login_wrap input[type="submit"] {
  width: 100% !important;
  max-width: 360px !important;
  display: inline-block !important;
  margin: 1.5rem 0 !important;
}

/* --- 2. Show Password を完全に小さなテキストリンクに（最強版） --- */
.pmpro_form .pmpro_password-toggle,
.pmpro_form button.pmpro_password-toggle,
.pmpro_form .pmpro_btn.pmpro_password-toggle,
button.pmpro_password-toggle.pmpro_btn,
.pmpro_login_wrap .pmpro_password-toggle {
  background: transparent !important;
  background-color: transparent !important;
  color: #6b7280 !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.25rem 0 !important;
  margin: 0.4rem 0 1.25rem !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  text-align: left !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.3rem;
  box-shadow: none !important;
  text-transform: none !important;
}

.pmpro_form .pmpro_password-toggle:hover {
  background: transparent !important;
  color: #1a2540 !important;
  text-decoration: underline;
}

/* --- 3. 入力欄の背景を強制的に白に（ログインページの灰色問題） --- */
.pmpro_form input[type="text"],
.pmpro_form input[type="email"],
.pmpro_form input[type="password"],
.pmpro_form input[type="tel"],
.pmpro_form input[type="number"],
.pmpro_form select,
.pmpro_form textarea,
.pmpro_form .input,
.pmpro_login_wrap input[type="text"],
.pmpro_login_wrap input[type="password"],
body.pmpro-login input[type="text"],
body.pmpro-login input[type="password"],
#loginform input[type="text"],
#loginform input[type="password"],
input#user_login,
input#user_pass {
  background: #fff !important;
  background-color: #fff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  padding: 0.75rem 0.9rem !important;
  width: 100% !important;
  max-width: 100% !important;
  font-size: 16px !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* --- 4. ログインページのラベル/フィールド配置を縦並び強制 --- */
body.pmpro-login .pmpro_form_field,
body.pmpro-login .pmpro_login_wrap p,
.pmpro_login_wrap p,
#loginform p {
  display: block !important;
  width: 100% !important;
  margin-bottom: 1.25rem !important;
}

body.pmpro-login label,
.pmpro_login_wrap label,
#loginform label {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  float: none !important;
  margin-bottom: 0.4rem !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
}

/* "ログイン状態を保存する" のチェックボックスは横並びに戻す */
.pmpro_form .pmpro_form_field-rememberme,
#loginform .login-remember,
.login-remember label {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin: 1rem 0 1.5rem !important;
}

.pmpro_form .pmpro_form_field-rememberme input,
#loginform .login-remember input {
  width: auto !important;
  margin: 0 !important;
}

/* --- 5. 全体の余白を確保（詰まり解消） --- */
body.pmpro-checkout .pmpro_form,
body.pmpro-login .pmpro_login_wrap,
body.pmpro-account .pmpro_account,
.pmpro_form,
.pmpro_login_wrap {
  padding: 2rem 1.25rem 4rem !important;
  max-width: 480px !important;
  margin: 0 auto !important;
}

/* セクション間の縦余白 */
.pmpro_form .pmpro_form_field,
.pmpro_form .pmpro_checkout-field,
.pmpro_login_wrap p {
  margin-bottom: 1.25rem !important;
}

/* "アカウント情報" 見出しの上下余白 */
.pmpro_form h2,
.pmpro_form h3,
.pmpro_form legend {
  margin-top: 0.5rem !important;
  margin-bottom: 1.25rem !important;
}

/* --- 6. "ここでログイン" の段落と送信ボタンの間に余白 --- */
.pmpro_form p,
.pmpro_login_wrap p.pmpro_actions_nav {
  margin: 1rem 0 1.5rem !important;
  line-height: 1.7;
}

/* --- 7. 入力欄フォーカス時のスタイルを再確実に --- */
.pmpro_form input:focus,
.pmpro_form select:focus,
.pmpro_form textarea:focus,
#loginform input:focus {
  background: #fff !important;
  border-color: #1a2540 !important;
  box-shadow: 0 0 0 3px rgba(26, 37, 64, 0.12) !important;
  outline: none !important;
}

/* --- 8. ページ全体の最低高さを確保（フッター詰まり対策） --- */
body.pmpro-checkout main,
body.pmpro-login main,
body.pmpro-account main,
.pmpro_login_wrap {
  min-height: 60vh;
  padding-bottom: 3rem !important;
}

/* ============================================
   Show Password を完全にプレーンリンク化
   （ログイン側の表示に統一）
   ============================================ */

/* .pmpro_btn-plain を持つボタンは全部プレーンに（最強上書き） */
.pmpro_form button.pmpro_btn-plain,
.pmpro_form .pmpro_btn.pmpro_btn-plain,
.pmpro_form_field-password-toggle button,
.pmpro_form_field-password-toggle .pmpro_btn,
button.pmpro_btn-password-toggle,
.pmpro_btn.pmpro_btn-password-toggle,
.pmpro_btn.pmpro_btn-plain.pmpro_btn-password-toggle {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #1a2540 !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.25rem 0 !important;
  margin: 0.5rem 0 1.25rem !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  box-shadow: none !important;
  cursor: pointer;
}

/* hover 時もプレーンを維持 */
.pmpro_form button.pmpro_btn-plain:hover,
.pmpro_form_field-password-toggle button:hover,
button.pmpro_btn-password-toggle:hover,
.pmpro_btn.pmpro_btn-plain.pmpro_btn-password-toggle:hover {
  background: transparent !important;
  background-color: transparent !important;
  color: #1a2540 !important;
  text-decoration: underline !important;
  box-shadow: none !important;
}

/* アイコンサイズも小さく */
.pmpro_form button.pmpro_btn-plain svg,
.pmpro_form_field-password-toggle button svg,
button.pmpro_btn-password-toggle svg {
  width: 18px !important;
  height: 18px !important;
  fill: currentColor;
}

/* ラッパーdivに余計な装飾が付いていれば消す */
.pmpro_form_field-password-toggle {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
}

/* SVGアイコンをアウトライン表示に統一（登録ページの塗りつぶし対策） */
.pmpro_btn.pmpro_btn-plain svg,
.pmpro_btn.pmpro_btn-password-toggle svg,
.pmpro_form_field-password-toggle svg,
.pmpro_btn.pmpro_btn-plain svg path,
.pmpro_btn.pmpro_btn-password-toggle svg path,
.pmpro_form_field-password-toggle svg path,
.pmpro_btn.pmpro_btn-plain svg circle,
.pmpro_btn.pmpro_btn-password-toggle svg circle {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.5 !important;
}

/* ユーザー名フィールドは廃止（メールをユーザー名に流用） */
body.pmpro-checkout .pmpro_form_field-username,
.pmpro_form .pmpro_form_fields .pmpro_form_field-username {
  display: none !important;
}

/* --- アカウント情報：メールを先・パスワードを後に並べ替え --- */
#pmpro_user_fields .pmpro_form_fields {
  display: flex !important;
  flex-direction: column !important;
}
#pmpro_user_fields .pmpro_form_fields > .pmpro_cols-2:has(#bemail)   { order: 1 !important; }
#pmpro_user_fields .pmpro_form_fields > .pmpro_cols-2:has(#password) { order: 2 !important; }