/* サインイン・パスワード関連フォーム（users/sessions, devise/passwords など） */

/* application レイアウトの .content-wrapper が height:0 のため、フォームページだけ展開 */
.content-wrapper:has(.signin-shell),
.content-wrapper:has(.main-content) {
  height: auto;
  min-height: 100vh;
  background: #f1f5f9;
}

.signin-shell,
.main-content {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 56px 20px 48px;
}

/* 新規登録ウィザードはカード内が広いためやや広く取る */
.signin-shell.signup-wizard-shell {
  max-width: 560px;
}

@media (min-width: 781px) {
  .signin-shell,
  .main-content {
    padding-top: 72px;
    padding-bottom: 64px;
  }

  .signin-shell.signup-wizard-shell {
    max-width: 640px;
  }
}

.form-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
  text-align: center;
  text-shadow: none;
}

.signin-lead {
  margin: 0 0 28px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #64748b;
  text-align: center;
}

.signin-alert {
  margin-bottom: 20px;
  padding: 12px 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
}

.signin-form {
  padding: 28px 24px 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px -12px rgba(15, 23, 42, 0.12);
}

.signin-form .field {
  margin-bottom: 20px;
}

.signin-form .field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  letter-spacing: 0.01em;
}

.signin-form .field input[type="email"],
.signin-form .field input[type="password"],
.signin-form .field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.4;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.signin-form .field input::placeholder {
  color: #94a3b8;
}

.signin-form .field input:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.signin-form .field input:focus {
  outline: none;
  border-color: #0ea5e9;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.field--remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px !important;
}

.field--remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0284c7;
  cursor: pointer;
}

.field--remember label {
  margin: 0 !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  color: #64748b !important;
  cursor: pointer;
}

.signin-form .actions {
  margin-top: 8px;
  text-align: center;
}

.signin-btn,
.signin-form .actions input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 14px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(3, 105, 161, 0.25);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.signin-btn:hover,
.signin-form .actions input[type="submit"]:hover {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 4px 14px -4px rgba(3, 105, 161, 0.45);
}

.signin-btn:active,
.signin-form .actions input[type="submit"]:active {
  transform: translateY(1px);
}

/* 旧 devise/sessions（リンクで送信）との互換 */
.signin-form .actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none;
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(3, 105, 161, 0.25);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.signin-form .actions a:hover {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 4px 14px -4px rgba(3, 105, 161, 0.45);
}

.signin-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #f1f5f9;
}

.signin-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0369a1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.signin-link:hover {
  color: #075985;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* パスワード再設定など（従来クラス） */
.sign-up_link,
.forget {
  margin: 0;
  text-align: center;
}

.sign-up_link {
  margin-top: 20px;
}

.forget {
  margin-top: 10px;
}

.sign-up_link a,
.forget a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0369a1;
  text-decoration: none;
}

.sign-up_link a:hover,
.forget a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#error_explanation {
  margin-bottom: 20px;
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
}

#error_explanation h2 {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

#error_explanation ul {
  margin: 0;
  padding-left: 1.1em;
}
