/* ============================================================
 * account.css — アカウントページ専用スタイル
 * 依存: base.css（ヘッダー・フォント・リセット）
 * ============================================================ */

/* ===== ヘッダー拡張（base.css の .header を継承） ===== */

/* ===== ページ共通 ===== */
body { background: #f0f0f0; }

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.spinner-large {
  width: 36px; height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: #37359A;
  border-radius: 50%;
  animation: acct-spin 0.7s linear infinite;
}
@keyframes acct-spin { to { transform: rotate(360deg); } }

.dev-warning {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  padding: 10px 16px;
  font-size: 12px;
  color: #7a5f00;
  line-height: 1.5;
  text-align: center;
}

.msg { min-height: 18px; font-size: 12px; margin-top: 8px; text-align: center; }
.msg.success { color: #2e7d32; }
.msg.error   { color: #c62828; }

/* ===== レイアウト ===== */
.account-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 14px 48px;
}

.account-section {
  background: #fff;
  border-radius: 14px;
  padding: 18px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ===== セクション見出し ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* section-title が section-header の外にある場合（ログイン方法等） */
.account-section > .section-title {
  display: block;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #bbb;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: #f0f0f0; color: #37359A; }
.btn-icon .material-symbols-outlined { font-size: 18px; }

/* ===== プロフィール表示（コンパクト） ===== */
.profile-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  gap: 12px;
}
.profile-row.last { border-bottom: none; }
.profile-label {
  font-size: 11px;
  color: #aaa;
  font-weight: 600;
  width: 88px;
  flex-shrink: 0;
}
.profile-value {
  font-size: 14px;
  color: #222;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== プロフィール編集 ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 12px;
  color: #555;
  font-weight: 600;
}
.field input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #222;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: #37359A;
  box-shadow: 0 0 0 3px rgba(55,53,154,0.1);
}
.field input:disabled { background: #f8f8f8; color: #999; cursor: default; }

.field-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* プロフィール表示↔編集 切替アニメーション */
@keyframes profileFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
#profile-display, #profile-edit {
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.profile-fade-out {
  opacity: 0 !important;
  transform: translateY(-4px) !important;
}
.profile-fade-in {
  animation: profileFadeIn 0.2s cubic-bezier(0.23,1,0.32,1) forwards;
}
.btn-save {
  flex: 2;
  height: 42px;
  background: #37359A;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-save:hover:not(:disabled) { background: #2d2c82; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cancel {
  flex: 1;
  height: 42px;
  background: #f3f4f6;
  color: #555;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-cancel:hover { background: #e5e7eb; }

/* ===== ログイン履歴 ===== */
.login-history-label {
  font-size: 11px;
  color: #bbb;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 14px;
  margin-bottom: 6px;
}
.login-hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #f8f8f8;
}
.login-hist-item:last-child { border-bottom: none; }
.login-hist-dt {
  font-size: 12px;
  color: #444;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.login-hist-device {
  font-size: 11px;
  color: #aaa;
}
.login-hist-empty { font-size: 12px; color: #bbb; }

/* ===== ログイン方法 ===== */
.provider-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.provider-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #ebebeb;
}
.provider-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.provider-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #222;
}
.btn-provider-unlink {
  background: transparent;
  border: 1px solid #e0c0c0;
  color: #c62828;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-provider-unlink:hover:not(:disabled) { background: #fff0f0; }
.btn-provider-unlink:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-provider-link {
  background: transparent;
  border: 1px solid #d0d0d0;
  color: #666;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-provider-link:hover:not(:disabled) { background: #f5f5f5; }
.btn-provider-link:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 法的情報 ===== */
.legal-links { display: flex; flex-direction: column; }
.legal-link {
  display: flex;
  align-items: center;
  padding: 12px 4px;
  color: #37359A;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid #f3f3f3;
  gap: 10px;
  transition: opacity 0.15s;
}
.legal-link:last-child { border-bottom: none; }
.legal-link:hover { opacity: 0.7; }
.legal-link-arrow { margin-left: auto; color: #ccc; }

/* ===== ログアウト ===== */
.btn-logout-full {
  width: 100%;
  height: 44px;
  background: transparent;
  color: #c62828;
  border: 1px solid #f5c0c0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-logout-full:hover { background: #fff0f0; }

/* ===== モバイル ===== */
@media (max-width: 640px) {
  .account-wrap { padding: 12px 12px 40px; }
  .account-section { padding: 14px 14px; border-radius: 12px; }
  .field input { height: 40px; font-size: 14px; }
  .btn-save, .btn-cancel { height: 40px; }
}
