.auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: var(--accent);
}

.auth-sub {
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.password-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.password-row input { flex: 1; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 6px 4px;
  cursor: pointer;
  flex: none;
}

.password-rules {
  list-style: none;
  margin: 0;
  padding: 0 0 0 2px;
  font-size: 0.76rem;
}
.password-rules li { color: var(--muted); }
.password-rules li.ok { color: #16a34a; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.auth-message {
  margin: 0;
  font-size: 0.85rem;
  min-height: 1.1em;
  color: var(--muted);
}
.auth-message.ok { color: #16a34a; }
.auth-message.error { color: #dc2626; }

.auth-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  font-size: 0.85rem;
}
.auth-links a {
  color: var(--accent2);
  text-decoration: underline;
}

.auth-note {
  margin: 16px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  flex: none;
}

/* hidden属性がCSSのdisplay指定（.auth-main等のflex）に負けて表示されてしまうのを防ぐ。
   ログイン済みでも「ご利用いただけません」カードが全員に見えてしまう重大バグの修正。 */
[hidden] { display: none !important; }
