/* ==========================================================================
   AkiLive ドキュメント・認証画面 — YouTube / Google 風デザイン
   対象: お問い合わせ / プライバシーポリシー / 利用規約 / 新規登録 /
         ログイン / ログアウト / アクセス拒否
   app.css（body.yt-page の共通部品）の上に重ねる。style.css の既存ルールを
   上書きするため、セレクタはすべて body.yt-docs から始める。
   ========================================================================== */

body.yt-docs {
  --yt-docs-surface: #f9f9f9;
  --yt-docs-input-border: #c4c7c5;
  --yt-docs-error: #d93025;
  --yt-docs-error-bg: #fce8e6;
  --yt-docs-success: #137333;
  --yt-docs-success-bg: #e6f4ea;
  --yt-docs-warn-bg: #fef7e0;
  --yt-docs-warn-text: #5f4300;

  min-height: 100vh;
  line-height: 1.6;
}

body.yt-docs *,
body.yt-docs *::before,
body.yt-docs *::after {
  box-sizing: border-box;
}

body.yt-docs a {
  display: inline;
  color: var(--yt-blue);
  text-decoration: none;
}

body.yt-docs a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   トップバー（既存のパンくずヘッダーをマストヘッド風に）
   -------------------------------------------------------------------------- */
body.yt-docs .yt-docs-bar {
  border-bottom: 1px solid var(--yt-border);
}

body.yt-docs .yt-docs-home {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px 0 4px;
  border-radius: 20px;
  color: var(--yt-text);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

body.yt-docs .yt-docs-home:hover {
  background-color: var(--yt-tonal-hover);
  text-decoration: none;
}

body.yt-docs .yt-docs-home svg {
  flex-shrink: 0;
  color: var(--yt-text-2);
}

body.yt-docs .yt-docs-crumb-sep {
  color: #ccc;
  font-size: 18px;
  line-height: 1;
}

body.yt-docs .yt-docs-crumb {
  font-size: 16px;
  font-weight: 500;
  color: var(--yt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

body.yt-docs .yt-docs-bar .yt-masthead-start {
  min-width: 0;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   ドキュメント本文（プライバシーポリシー・利用規約）
   -------------------------------------------------------------------------- */
body.yt-docs .yt-doc {
  max-width: 800px;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 80px;
}

body.yt-docs .yt-doc-header {
  padding: 16px 0 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--yt-border);
}

body.yt-docs .doc-title {
  margin: 0;
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  color: var(--yt-text);
  text-align: left;
  letter-spacing: -0.2px;
}

body.yt-docs .doc-date {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--yt-text-2);
}

body.yt-docs .yt-doc .section {
  margin: 0 0 36px;
}

body.yt-docs .yt-doc .section-title {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  color: var(--yt-text);
}

body.yt-docs .yt-doc p,
body.yt-docs .yt-doc li {
  font-size: 15px;
  line-height: 1.85;
  color: #272727;
}

body.yt-docs .yt-doc p {
  margin: 0 0 12px;
}

body.yt-docs .yt-doc ul,
body.yt-docs .yt-doc ol {
  margin: 0 0 12px;
  padding-left: 1.6em;
}

body.yt-docs .yt-doc li {
  margin-bottom: 8px;
  padding-left: 4px;
}

body.yt-docs .yt-doc li::marker {
  color: var(--yt-text-2);
}

body.yt-docs .yt-doc strong {
  font-weight: 700;
  color: var(--yt-text);
}

body.yt-docs .yt-doc a {
  color: var(--yt-blue);
}

/* 注意書き（利用規約のゼロ・トレランス方針など） */
body.yt-docs .warning-box {
  margin: 0 0 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--yt-docs-warn-bg);
  color: var(--yt-docs-warn-text);
  font-size: 14px;
  line-height: 1.8;
}

body.yt-docs .warning-box-danger {
  background: var(--yt-docs-error-bg);
  color: #a50e0e;
}

body.yt-docs .warning-box-danger strong {
  color: #a50e0e;
}

body.yt-docs .warning-box-lead {
  margin-bottom: 32px;
  font-weight: 500;
}

body.yt-docs .yt-doc .divider {
  height: 0;
  margin: 40px 0;
  border: none;
  border-top: 1px solid var(--yt-border);
}

/* 末尾のお問い合わせ窓口 */
body.yt-docs .contact-box {
  padding: 24px;
  border-radius: 12px;
  background: var(--yt-tonal);
}

body.yt-docs .yt-doc .contact-box .section-title {
  font-size: 16px;
  line-height: 24px;
  margin-bottom: 8px;
}

body.yt-docs .yt-doc .contact-box p {
  margin-bottom: 4px;
  color: var(--yt-text-2);
}

body.yt-docs .yt-doc .contact-box .contact-org {
  margin-top: 16px;
}

body.yt-docs .yt-doc .contact-box .contact-org strong {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   お問い合わせフォーム
   -------------------------------------------------------------------------- */
body.yt-docs .yt-contact {
  max-width: 688px;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 80px;
}

body.yt-docs .yt-contact .yt-doc-header {
  margin-bottom: 24px;
  border-bottom: none;
  padding-bottom: 0;
}

body.yt-docs .doc-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--yt-text-2);
}

body.yt-docs .alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 22px;
}

body.yt-docs .alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

body.yt-docs .alert-success {
  background: var(--yt-docs-success-bg);
  color: var(--yt-docs-success);
}

body.yt-docs .alert-error {
  background: var(--yt-docs-error-bg);
  color: #a50e0e;
}

body.yt-docs .form-card {
  padding: 32px;
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  background: var(--yt-bg);
}

body.yt-docs .yt-contact .form-group {
  margin: 0 0 24px;
}

body.yt-docs .yt-contact .form-group label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--yt-text);
}

body.yt-docs .yt-contact .form-group label .required {
  margin-left: 4px;
  color: #cc0000;
}

/* 入力欄（お問い合わせ・ログイン・新規登録で共通） */
body.yt-docs .yt-contact .form-group input,
body.yt-docs .yt-contact .form-group select,
body.yt-docs .yt-contact .form-group textarea,
body.yt-docs .yt-auth-form input[type="text"],
body.yt-docs .yt-auth-form input[type="email"],
body.yt-docs .yt-auth-form input[type="password"] {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--yt-docs-input-border);
  border-radius: 8px;
  background: var(--yt-bg);
  color: var(--yt-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  box-shadow: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.yt-docs .yt-contact .form-group textarea {
  height: auto;
  min-height: 168px;
  padding: 12px 14px;
  line-height: 1.7;
  resize: vertical;
}

body.yt-docs .yt-contact .form-group select {
  padding-right: 40px;
  cursor: pointer;
}

body.yt-docs .yt-contact .form-group select:invalid {
  color: #909090;
}

body.yt-docs .yt-contact .form-group input:hover,
body.yt-docs .yt-contact .form-group select:hover,
body.yt-docs .yt-contact .form-group textarea:hover,
body.yt-docs .yt-auth-form input[type="text"]:hover,
body.yt-docs .yt-auth-form input[type="email"]:hover,
body.yt-docs .yt-auth-form input[type="password"]:hover {
  border-color: var(--yt-text);
}

body.yt-docs .yt-contact .form-group input:focus,
body.yt-docs .yt-contact .form-group select:focus,
body.yt-docs .yt-contact .form-group textarea:focus,
body.yt-docs .yt-auth-form input[type="text"]:focus,
body.yt-docs .yt-auth-form input[type="email"]:focus,
body.yt-docs .yt-auth-form input[type="password"]:focus {
  border-color: var(--yt-blue);
  box-shadow: 0 0 0 1px var(--yt-blue);
  background: var(--yt-bg);
}

body.yt-docs .yt-contact .form-group input::placeholder,
body.yt-docs .yt-contact .form-group textarea::placeholder,
body.yt-docs .yt-auth-form input::placeholder {
  color: #909090;
}

body.yt-docs .select-wrapper {
  position: relative;
}

body.yt-docs .select-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--yt-text-2);
  transform: translateY(-50%);
  pointer-events: none;
}

/* 送信ボタン（YouTube の青いピルボタン） */
body.yt-docs .submit-btn,
body.yt-docs .yt-auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin: 8px 0 0;
  padding: 0 24px;
  border: none;
  border-radius: 22px;
  background: var(--yt-blue);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 44px;
  cursor: pointer;
  box-shadow: none;
  transform: none;
  opacity: 1;
  transition: background-color 0.15s ease;
}

body.yt-docs .submit-btn:hover,
body.yt-docs .yt-auth-submit:hover {
  background: #0556bf;
  transform: none;
  box-shadow: none;
  opacity: 1;
}

body.yt-docs .submit-btn:active,
body.yt-docs .yt-auth-submit:active {
  transform: none;
  background: #044ba3;
}

body.yt-docs .submit-btn:focus-visible,
body.yt-docs .yt-auth-submit:focus-visible {
  outline: 2px solid var(--yt-blue);
  outline-offset: 2px;
}

body.yt-docs .submit-btn:disabled,
body.yt-docs .yt-auth-submit:disabled {
  background: var(--yt-blue);
  opacity: 0.7;
  cursor: default;
}

/* 送信中のスピナー（JS が .loading を付ける） */
body.yt-docs .submit-btn .btn-loader,
body.yt-docs .yt-auth-submit .btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: yt-docs-spin 0.8s linear infinite;
}

body.yt-docs .submit-btn .btn-text,
body.yt-docs .yt-auth-submit .btn-text {
  display: inline;
  opacity: 1;
}

body.yt-docs .submit-btn.loading .btn-text,
body.yt-docs .yt-auth-submit.loading .btn-text {
  opacity: 0;
}

body.yt-docs .submit-btn.loading .btn-loader,
body.yt-docs .yt-auth-submit.loading .btn-loader {
  opacity: 1;
}

@keyframes yt-docs-spin {
  to {
    transform: rotate(360deg);
  }
}

body.yt-docs .privacy-note {
  margin: 20px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--yt-text-2);
  text-align: center;
}

body.yt-docs .privacy-note a {
  color: var(--yt-blue);
}

/* --------------------------------------------------------------------------
   認証画面（ログイン・新規登録・ログアウト・アクセス拒否）— Google のログインカード風
   style.css の .login-page / .signup-page / .logout-page を上書き
   -------------------------------------------------------------------------- */
body.yt-docs.yt-auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 48px 16px;
  background: #f2f2f2;
}

html:has(body.yt-docs.yt-auth-page) {
  background: #f2f2f2;
}

body.yt-docs .yt-auth-container {
  width: 100%;
  max-width: 448px;
}

body.yt-docs .yt-auth-container-wide {
  max-width: 560px;
}

body.yt-docs .yt-auth-card {
  width: 100%;
  padding: 44px 40px 36px;
  border: none;
  border-radius: 24px;
  background: var(--yt-bg);
  box-shadow: none;
  text-align: left;
}

body.yt-docs .yt-auth-card-center {
  text-align: center;
}

body.yt-docs .yt-auth-header {
  margin: 0 0 32px;
  text-align: center;
}

/* ロゴ（マストヘッドの .yt-logo と同じ見た目） */
body.yt-docs .yt-auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--yt-text);
  text-align: center;
}

body.yt-docs .yt-auth-logo::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yt-red);
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.18);
}

body.yt-docs .yt-auth-title {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 400;
  color: var(--yt-text);
}

body.yt-docs .yt-auth-form {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

body.yt-docs .yt-auth-form .form-group {
  margin: 0 0 20px;
  padding: 0;
}

body.yt-docs .yt-auth-form .form-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin: 0 0 20px;
}

body.yt-docs .yt-auth-form .form-group.half {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

body.yt-docs .yt-auth-form label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--yt-text);
}

body.yt-docs .yt-auth-form label:hover {
  background: transparent;
}

/* ヘルプテキスト（パスワード要件の <ul> を含む） */
body.yt-docs .yt-auth-form .help-text {
  display: block;
  margin: 6px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--yt-text-2);
}

body.yt-docs .yt-auth-form .help-text ul {
  margin: 0;
  padding-left: 1.3em;
}

body.yt-docs .yt-auth-form .help-text li {
  margin: 2px 0 0;
}

/* エラー表示 */
body.yt-docs .yt-auth-form .error-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

body.yt-docs .yt-auth-form .error-list li {
  position: relative;
  margin: 0 0 2px;
  padding-left: 22px;
  font-size: 12px;
  line-height: 18px;
  color: var(--yt-docs-error);
}

body.yt-docs .yt-auth-form .error-list li::before {
  content: "!";
  position: absolute;
  top: 1px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yt-docs-error);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* style.css の #id_email { width: 325px } を打ち消す */
body.yt-docs .yt-auth-form #id_email {
  width: 100%;
  max-width: none;
}

body.yt-docs .yt-auth-form .form-group:has(.error-list) input[type="text"],
body.yt-docs .yt-auth-form .form-group:has(.error-list) input[type="email"],
body.yt-docs .yt-auth-form .form-group:has(.error-list) input[type="password"] {
  border-color: var(--yt-docs-error);
}

body.yt-docs .yt-auth-form .form-group:has(.error-list) input:focus {
  box-shadow: 0 0 0 1px var(--yt-docs-error);
}

body.yt-docs .yt-auth-form .form-errors {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--yt-docs-error-bg);
}

body.yt-docs .yt-auth-form .form-errors .error-message {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
  color: #a50e0e;
}

/* 利用規約への同意（新規登録） */
body.yt-docs .yt-auth-form .yt-agree {
  margin: 4px 0 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--yt-tonal);
}

body.yt-docs .yt-auth-form .yt-agree label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 400;
  color: var(--yt-text);
  cursor: pointer;
}

body.yt-docs .yt-auth-form .yt-agree input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--yt-blue);
  cursor: pointer;
}

body.yt-docs .yt-auth-form .yt-agree a {
  display: inline;
  color: var(--yt-blue);
  font-weight: 500;
}

body.yt-docs .yt-auth-form .yt-agree strong {
  display: inline-block;
  margin-top: 6px;
  font-weight: 500;
  color: #a50e0e;
}

body.yt-docs .yt-auth-form .yt-agree .error-list {
  margin-left: 30px;
}

/* カード下部のリンク行 */
body.yt-docs .yt-auth-footer {
  margin: 24px 0 0;
  padding: 0;
  border: none;
  text-align: center;
}

body.yt-docs .yt-auth-footer p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--yt-text-2);
}

body.yt-docs .yt-auth-footer a {
  display: inline;
  margin-left: 2px;
  color: var(--yt-blue);
  font-weight: 500;
  background: transparent;
}

body.yt-docs .yt-auth-footer a:hover {
  color: var(--yt-blue);
  background: transparent;
  text-decoration: underline;
}

/* メッセージだけのカード（ログアウト・アクセス拒否） */
body.yt-docs .yt-auth-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--yt-tonal);
  color: var(--yt-text-2);
}

body.yt-docs .yt-auth-message {
  margin: 8px 0 32px;
  font-size: 14px;
  line-height: 20px;
  color: var(--yt-text-2);
}

body.yt-docs .yt-auth-card-center .yt-auth-title {
  font-size: 20px;
  line-height: 28px;
  text-wrap: balance;
}

body.yt-docs .yt-auth-card-center .yt-auth-title + .yt-auth-action {
  margin-top: 32px;
}

body.yt-docs .yt-auth-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 160px;
  max-width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 24px;
  border: none;
  border-radius: 20px;
  background: var(--yt-blue);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
  transform: none;
  transition: background-color 0.15s ease;
}

body.yt-docs .yt-auth-action:hover {
  background: #0556bf;
  color: #fff;
  text-decoration: none;
  box-shadow: none;
  transform: none;
}

/* --------------------------------------------------------------------------
   スマートフォン
   -------------------------------------------------------------------------- */
@media (max-width: 1030px) {
  body.yt-docs .yt-doc,
  body.yt-docs .yt-contact {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 56px;
  }

  body.yt-docs .yt-docs-bar {
    padding-right: 16px;
  }
}

@media (max-width: 600px) {
  body.yt-docs .yt-doc-header {
    padding-top: 8px;
    padding-bottom: 20px;
    margin-bottom: 28px;
  }

  body.yt-docs .doc-title {
    font-size: 24px;
    line-height: 32px;
  }

  body.yt-docs .yt-doc .section-title {
    font-size: 18px;
    line-height: 26px;
  }

  body.yt-docs .yt-doc .section {
    margin-bottom: 32px;
  }

  body.yt-docs .warning-box {
    padding: 14px 16px;
  }

  body.yt-docs .contact-box {
    padding: 20px 16px;
  }

  body.yt-docs .form-card {
    padding: 0;
    border: none;
    border-radius: 0;
  }

  body.yt-docs .yt-docs-crumb {
    font-size: 15px;
  }

  /* 認証画面: Google と同じくスマホではカードを外して白背景に */
  body.yt-docs.yt-auth-page {
    justify-content: flex-start;
    padding: 32px 16px 40px;
    background: var(--yt-bg);
  }

  html:has(body.yt-docs.yt-auth-page) {
    background: #ffffff;
  }

  body.yt-docs .yt-auth-card {
    padding: 0;
    border-radius: 0;
  }

  body.yt-docs .yt-auth-card-center {
    padding-top: 48px;
  }

  body.yt-docs .yt-auth-card-center .yt-auth-title {
    font-size: 18px;
    line-height: 26px;
  }

  body.yt-docs .yt-auth-header {
    margin-bottom: 28px;
  }

  body.yt-docs .yt-auth-form .form-row {
    flex-direction: column;
    gap: 20px;
  }

  body.yt-docs .yt-auth-action {
    width: 100%;
  }
}
