/* ==========================================================================
   認証ページスタイル
   デザインプレビュー login.html / sign_up.html から抽出
   CSS変数ベース（テーマシステム対応）
   ========================================================================== */

/* auth.css 用の追加変数（テーマ変数に依存） */
.auth-body {
  background: var(--body-bg, #f0e8dc);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

/* --- Layout --- */
.auth-container {
  max-width: 480px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* --- Brand --- */
.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-brand-logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.auth-brand-logo i {
  color: var(--accent);
  margin-right: 0.375rem;
}
.auth-brand-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* --- Card --- */
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}
.auth-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* --- Form Elements --- */
.auth-field {
  margin-bottom: 1.25rem;
}
.auth-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}
.auth-label-required {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-error, #dc2626);
  background: rgba(220, 38, 38, 0.08);
  padding: 0.1rem 0.375rem;
  border-radius: 3px;
}
.auth-label-hint {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: auto;
}
.auth-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg, #f9fafb);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.auth-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* --- Input with icon --- */
.auth-input-wrapper {
  position: relative;
}
.auth-input-wrapper .auth-input {
  padding-left: 2.75rem;
}
.auth-input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}
.auth-input-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
}
.auth-input-toggle:hover {
  color: var(--text-secondary);
}

/* --- Help text --- */
.auth-help {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* --- Submit button --- */
.auth-submit {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}
.auth-submit:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.auth-submit:active {
  transform: translateY(0);
}
.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Forgot password --- */
.auth-forgot {
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}
.auth-forgot a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 600;
}
.auth-forgot a:hover {
  text-decoration: underline;
}

/* --- Divider --- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* --- Easy login button --- */
.auth-easy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.auth-easy-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.04);
  color: var(--accent);
}
.auth-easy-btn i {
  font-size: 1.1rem;
}

/* --- Error / Notice --- */
.auth-error {
  display: none;
  padding: 0.75rem 1rem;
  background: var(--error-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--color-error, #dc2626);
  margin-bottom: 1rem;
  align-items: center;
  gap: 0.5rem;
}
.auth-error.show {
  display: flex;
}
.auth-error i {
  flex-shrink: 0;
}
.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.auth-notice i {
  color: var(--accent);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* --- Field-level error --- */
.auth-input.error {
  border-color: var(--color-error, #dc2626);
  background: rgba(220, 38, 38, 0.02);
}
.auth-field-error {
  display: none;
  font-size: 0.72rem;
  color: var(--color-error, #dc2626);
  margin-top: 0.25rem;
  align-items: center;
  gap: 0.25rem;
}
.auth-field-error.show {
  display: flex;
}

/* --- Footer links --- */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* --- Method selector (signup page) --- */
.auth-method-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.auth-method-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-out;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  position: relative;
}
.auth-method-btn i {
  font-size: 1.25rem;
}
.auth-method-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.03);
}
.auth-method-btn.active {
  border-color: var(--accent);
  border-width: 2px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}
.auth-method-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 0.55rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 0.1rem 0.375rem;
  border-radius: 4px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* --- Method form sections --- */
.auth-method-form {
  display: none;
}
.auth-method-form.active {
  display: block;
}

/* --- Password strength --- */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 0.375rem;
}
.password-strength-bar {
  flex: 1;
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
  transition: background 0.3s;
}
.password-strength[data-level="1"] .password-strength-bar:nth-child(1) { background: var(--color-error, #dc2626); }
.password-strength[data-level="2"] .password-strength-bar:nth-child(-n+2) { background: var(--color-warning, #f59e0b); }
.password-strength[data-level="3"] .password-strength-bar:nth-child(-n+3) { background: var(--color-success, #10b981); }
.password-strength[data-level="4"] .password-strength-bar { background: var(--accent); }
.password-strength-text {
  font-size: 0.7rem;
  margin-top: 0.125rem;
  color: var(--text-muted);
}

/* --- Password requirements --- */
.password-requirements {
  list-style: none;
  padding: 0;
  margin: 0.375rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.password-requirements li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0;
}
.password-requirements li i {
  font-size: 0.6rem;
  width: 0.85rem;
}
.password-requirements li.valid { color: var(--color-success, #10b981); }
.password-requirements li.valid i { color: var(--color-success, #10b981); }

/* --- Easy login section --- */
.auth-easy-section {
  padding-top: 0.5rem;
}
.auth-easy-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.auth-easy-notice i {
  color: var(--color-warning, #f59e0b);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.auth-easy-limits {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.auth-easy-limits li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.06);
}
.auth-easy-limits li:last-child {
  border-bottom: none;
}
.auth-easy-limits li i {
  font-size: 0.85rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}
.auth-easy-limits li.enabled { color: var(--text-secondary); font-weight: 500; }
.auth-easy-limits li.enabled i { color: var(--color-success, #10b981); }
.auth-easy-limits li.disabled { color: var(--text-muted); }
.auth-easy-limits li.disabled i { color: var(--color-error, #dc2626); }
.auth-easy-agree {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.4;
}
.auth-easy-agree input[type="checkbox"] {
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

/* --- Trust signals --- */
.auth-trust-signals {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  margin: 1.5rem 0 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(var(--accent-rgb), 0.03);
  border-radius: 8px;
}
.trust-signal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}
.trust-signal i {
  font-size: 1.1rem;
  color: var(--accent);
}

/* --- Terms --- */
.auth-terms {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.5;
}
.auth-terms a {
  color: var(--text-secondary);
  text-decoration: underline;
}
.auth-terms a:hover {
  color: var(--accent);
}

/* --- Verification code --- */
.auth-code-inputs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.auth-code-input {
  width: 48px;
  height: 52px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg, #f9fafb);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.auth-code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
  transform: scale(1.05);
  z-index: 1;
}
.auth-resend {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.78rem;
}
.auth-resend a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.auth-resend a:hover {
  text-decoration: underline;
}

/* --- Back link --- */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: color 0.2s;
}
.auth-back-link:hover {
  color: var(--accent);
}

/* --- Confirm header --- */
.auth-confirm-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-confirm-header i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .auth-container {
    margin: 0.75rem auto;
  }
  .auth-card {
    padding: 1.25rem 1rem;
  }
  .auth-brand {
    margin-bottom: 1rem;
  }
  .auth-card-title {
    margin-bottom: 0.25rem;
  }
  .auth-card-subtitle {
    margin-bottom: 1rem;
  }
  .auth-method-selector {
    margin-bottom: 1rem;
  }
  .auth-method-btn {
    padding: 0.5rem 0.25rem;
    font-size: 0.65rem;
  }
  .auth-method-btn i {
    font-size: 1.1rem;
  }
  .auth-field {
    margin-bottom: 1rem;
  }
  .auth-code-input {
    width: 40px;
    height: 44px;
    font-size: 1.1rem;
  }
  .auth-trust-signals {
    gap: 0.5rem;
    padding: 0.625rem 0.5rem;
  }
  .trust-signal {
    font-size: 0.6rem;
  }
}
