/* 共通ログイン画面のデザイン。template のグラスデザイン（app/style.css の .bg と .login-card、
   controls.css の g-btn）と同じ寸法・質感にそろえた。背景の写真はサーバーが毎回選んで --bg-image に入れる。 */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  background: #6b8f86; color: #1a1a1a; -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) { body { background: #1b2b27; } }

.bg {
  position: fixed; inset: 0; z-index: -1;
  background-image: var(--bg-image, linear-gradient(135deg, #2f6f5e, #6b8fb8));
  background-size: cover; background-position: center;
}

main.container {
  flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}

/* template の .login-card と同じ（Anota のログインカードと同じ寸法・質感）。写真の上なので、ダークでも白いカードにする */
.login-card {
  width: 340px; max-width: 100%; padding: 40px 36px;
  background: rgba(255, 255, 255, .82); color: #1a1a1a;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, .08); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  color-scheme: light;
}
.login-logo {
  font-size: 1.8rem; font-weight: bold; text-align: center;
  margin: 0 0 8px; letter-spacing: .05em; overflow-wrap: anywhere;
}
.login-sub { margin: 0 0 28px; font-size: .9rem; text-align: center; color: rgba(0, 0, 0, .6); }
.login-description {
  margin: 20px 0 0; font-size: .82rem; line-height: 1.7;
  text-align: center; color: rgba(0, 0, 0, .6);
}
.login-card h2 { font-size: 1.2rem; margin: 0 0 12px; text-align: center; }
.login-card p { line-height: 1.7; }
.muted { color: rgba(0, 0, 0, .6); font-size: .88rem; }

/* ボタン（template の controls.css の g-btn と同じ形） */
.g-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 42px; padding: 10px 16px; margin-top: 12px;
  border-radius: 10px; border: 1px solid rgba(0, 0, 0, .12);
  background: #fff; color: #1f1f1f; font: inherit; font-size: .95rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s;
}
.g-btn:hover { background: #f6f8f7; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.g-btn:focus-visible { outline: 2px solid #2f6f5e; outline-offset: 2px; }
.g-btn-primary { background: #2f6f5e; color: #fff; border-color: transparent; }
.g-btn-primary:hover { background: #285f51; }
.g-btn svg { flex: none; }

.sep { border: none; border-top: 1px solid rgba(0, 0, 0, .1); margin: 24px 0 16px; }
input[type="email"] {
  width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .15); background: rgba(255, 255, 255, .7); color: #1a1a1a; font: inherit;
}

/* アカウントの画面 */
.profile { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-initial {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: #2f6f5e; color: #fff; font-weight: bold; font-size: 1.2rem;
}
.profile .name { font-weight: 600; }
.profile .email { font-size: .85rem; color: rgba(0, 0, 0, .6); overflow-wrap: anywhere; }
.services { list-style: none; padding: 0; margin: 8px 0 0; }
.services li { padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, .6); margin-top: 6px; font-size: .92rem; }

.site-footer {
  text-align: center; font-size: .78rem; padding: 10px 16px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  background: rgba(255, 255, 255, .12); border-top: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

@media (max-width: 380px) { .login-card { padding: 32px 24px; } }

/* 共通のプロフィール（AUTH-19）。ほかのサービスの設定の画面と同じ 2 ペイン（template のグラス UI の寸法と色）。
   CSS を変えると URL の版が変わり、ブラウザが読み直す */
body.acct-body {
  --glass: rgba(255, 255, 255, .62); --glass-line: rgba(255, 255, 255, .55); --glass-hover: rgba(255, 255, 255, .5);
  --pane-solid: rgba(255, 255, 255, .93); --accent: #2f6f5e; --accent-fg: #fff; --line: rgba(0, 0, 0, .08);
  height: 100vh; height: 100dvh; overflow: hidden; color-scheme: light;
}
.acct-header {
  display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 4px 14px;
  background: rgba(255, 255, 255, .12); border-bottom: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.acct-header .brand { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; text-decoration: none; white-space: nowrap; }
.acct-header .back-link { color: #fff; font-size: .88rem; text-decoration: none; padding: 3px 10px; border-radius: 6px; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .25); white-space: nowrap; }
.acct-header .back-link:hover { background: rgba(255, 255, 255, .28); }
.spacer { flex: 1; }
.avatar.sm, .avatar-initial.sm { width: 32px; height: 32px; font-size: .85rem; border: 2px solid rgba(255, 255, 255, .4); box-sizing: border-box; }
.avatar.lg, .avatar-initial.lg { width: 42px; height: 42px; font-size: 1rem; }
/* ユーザーメニュー（template の app/style.css と同じ形。JavaScript なしで details で開く） */
.user-area { position: relative; flex-shrink: 0; }
.user-btn { list-style: none; cursor: pointer; display: flex; align-items: center; border-radius: 50%; }
.user-btn::-webkit-details-marker { display: none; }
.user-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; z-index: 950; overflow: hidden;
  background: rgba(30, 30, 50, .95); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  color: #fff; text-shadow: none;
}
.user-menu-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.user-id { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: bold; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email { font-size: .85rem; opacity: .8; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 2px 0; }
.user-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: inherit; font-size: .88rem; text-decoration: none; }
.user-menu a:hover, .user-menu a:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.user-menu .menu-icon { flex: none; opacity: .8; }
.user-menu .logout { color: #f99; }
.user-menu .logout:hover, .user-menu .logout:focus-visible { background: rgba(220, 50, 50, .2); }
.glass {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 16px;
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
}
.acct-panes { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: clamp(220px, 21vw, 300px) minmax(0, 1fr); gap: 6px; padding: 16px 14px 12px 0; }
.acct-nav { padding: 14px; border-radius: 0 16px 16px 0; border-left: none; overflow-y: auto; }
.acct-nav h2 { font-size: 1.05rem; margin: 0 0 10px; }
.acct-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-nav a { display: block; padding: 6px 12px; border-radius: 10px; color: inherit; text-decoration: none; font-size: .88rem; }
.acct-nav a:hover { background: var(--glass-hover); }
.acct-nav a.active { background: var(--accent); color: var(--accent-fg); }
.acct-main {
  min-height: 0; overflow-y: auto; padding: 18px 22px; border-radius: 16px; background: var(--pane-solid);
  border: 1px solid var(--glass-line); box-shadow: 0 8px 32px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 14px;
}
.acct-heading { font-size: 1.15rem; margin: 0; }
.block { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .6); max-width: 760px; }
.block h3 { font-size: .98rem; margin: 0 0 8px; }
.block .profile { margin: 0 0 8px; }
.small { font-size: .8rem; }
.notice { background: rgba(47, 111, 94, .12); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin: 0; max-width: 760px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: middle; }
.tiers { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tiers th, .tiers td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tiers th, .tiers td.price { white-space: nowrap; }
.tiers tr.current { background: rgba(47, 111, 94, .08); }
.apps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; max-width: 900px; }
.apps li { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); }
.apps img { border-radius: 8px; flex: none; }
.app-body { flex: 1; min-width: 0; }
.apps .name a { color: inherit; font-weight: 600; text-decoration: none; }
.apps .name a:hover { text-decoration: underline; }
.app-links { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.app-open { display: inline-block; padding: 4px 14px; border-radius: 8px; background: var(--accent); color: #fff !important; font-size: .82rem; font-weight: 600; text-decoration: none !important; }
.app-open:hover { background: #285f51; }
.devices { list-style: none; padding: 0; margin: 0; }
.devices li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.devices li:last-child { border-bottom: none; }
.devices li > div { flex: 1; min-width: 0; }
.acct-logout { width: auto; display: inline-flex; padding: 10px 28px; }
.link-btn { background: none; border: none; padding: 0; font: inherit; font-size: .82rem; color: var(--accent); text-decoration: underline; cursor: pointer; white-space: nowrap; }
body.acct-body .site-footer { margin: 0; padding: 4px 16px 6px; font-size: .75rem; }
body.acct-body .site-footer a { color: #fff; }
@media (max-width: 720px) {
  body.acct-body { height: auto; overflow: visible; }
  .acct-panes { grid-template-columns: 1fr; align-items: start; align-content: start; padding: 10px; gap: 10px; }
  .acct-nav { border-radius: 16px; border-left: 1px solid var(--glass-line); }
  .acct-nav ul { flex-direction: row; overflow-x: auto; }
  .acct-nav a { white-space: nowrap; }
  .acct-main { padding: 14px; }
  .tiers td.muted { display: none; }
  .acct-header .brand { font-size: .95rem; }
}
.name-form { margin: 6px 0 4px; display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.name-form label { font-size: .85rem; font-weight: 600; margin-top: 6px; }
.name-form input, .name-form select { padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .18); font: inherit; background: #fff; color: #1a1a1a; }
.name-form .muted { margin: 0; }
.name-form .g-btn { width: auto; align-self: flex-start; margin: 6px 0 0; min-height: 38px; padding: 6px 22px; }
.plan-compare { max-width: 980px; overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 620px; }
.compare th, .compare td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { text-align: center; font-size: .92rem; border-bottom: 2px solid var(--line); }
.compare thead th .price { font-weight: 400; font-size: .8rem; color: rgba(0, 0, 0, .6); margin-top: 2px; }
.compare tbody th { white-space: nowrap; font-weight: 600; }
.compare td { text-align: center; }
.compare .current { background: rgba(47, 111, 94, .08); }

/* アプリランチャー（template の app/style.css と同じ形。JavaScript なしで details で開く） */
.app-launcher { position: relative; flex-shrink: 0; }
.launcher-btn {
  list-style: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50%; color: #fff; cursor: pointer; opacity: .85;
}
.launcher-btn::-webkit-details-marker { display: none; }
.launcher-btn:hover, .app-launcher[open] .launcher-btn { background: rgba(255, 255, 255, .18); opacity: 1; }
.launcher-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.launcher-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: calc(100vw - 24px); z-index: 950; overflow: hidden;
  background: rgba(30, 30, 50, .95); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  color: #fff; text-shadow: none;
}
.launcher-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; max-height: min(70vh, 520px); overflow-y: auto; }
.launcher-app { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.launcher-app:hover, .launcher-app:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.launcher-icon { flex: none; width: 40px; height: 40px; display: flex; }
.launcher-icon img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.launcher-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.launcher-name { font-weight: bold; font-size: .9rem; }
.launcher-note { font-size: .78rem; opacity: .75; }
.launcher-foot { display: block; padding: 10px 16px; border-top: 1px solid rgba(255, 255, 255, .12); color: inherit; font-size: .85rem; text-align: center; text-decoration: none; }
.launcher-foot:hover, .launcher-foot:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }

/* スマホ幅: ボタンの右端に合わせると 320px のパネルが画面の左からはみ出すので、右へずらして画面の右端から 12px に置く
   （ボタンの右には、ユーザーのアイコン 32px・間 12px・ヘッダーの余白 14px がある） */
@media (max-width: 480px) {
  .launcher-panel { right: -48px; width: min(320px, calc(100vw - 24px)); }
}
