/* CYCLE devise pages */

:root {
  --devise-primary: #016554;
  --devise-primary-hover: #014f43;
  --devise-disabled: #d7dbe3;
  --devise-border: rgba(0, 0, 0, 0.1);
  --devise-border-focus: #016554;
  --devise-link: #1165EF;
  --devise-bg: #f6f6f6;
  --devise-card-bg: #ffffff;
  --devise-text: #1A1A1A;
  --devise-text-muted: #525252;
}

.devise-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--devise-text);
  padding: 84px 24px 24px;
  box-sizing: border-box;
}

.devise-auth-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.devise-logo-wrap {
  width: min(286px, 100%);
  margin: 0 auto 62px;
}

.devise-logo-image {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.devise-card {
  width: 100%;
  max-width: 420px;
  background: var(--devise-card-bg);
  border-radius: 8px;
  border: 1px solid #e2e5ea;
  box-shadow: rgba(0, 0, 0, 0.03) 0px 1px 8px 0px;
  padding: 36px 24px 28px;
  box-sizing: border-box;
}

.devise-title {
  font-size: 32px;
  font-weight: 700;
  text-align: left;
  margin: 0 0 32px;
  color: var(--devise-text);
  line-height: 1.2;
}

.devise-field {
  margin-bottom: 18px;
}

.devise-field label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--devise-text);
  margin-bottom: 8px;
  line-height: 20px;
}

.devise-field label .required {
  color: #dc3545;
  margin-left: 2px;
}

.devise-field input[type="email"],
.devise-field input[type="password"],
.devise-field input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--devise-border);
  border-radius: 8px;
  background: var(--devise-card-bg);
  box-sizing: border-box;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.devise-field input[type="email"]:focus,
.devise-field input[type="password"]:focus,
.devise-field input[type="text"]:focus {
  outline: none;
  border-color: var(--devise-border-focus);
}

.devise-field input::placeholder {
  color: #a9a9a9;
}

.devise-forgot {
  text-align: center;
  margin: -2px 0 20px;
  font-size: 13px;
  color: var(--devise-text-muted);
  line-height: 20px;
}

.devise-forgot a {
  font-size: 13px;
  color: var(--devise-link);
  text-decoration: none;
}

.devise-forgot a:hover {
  text-decoration: underline;
}

.devise-actions {
  margin-bottom: 18px;
}

.devise-actions input[type="submit"] {
  width: 100%;
  height: 48px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background-color: var(--devise-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.devise-actions input[type="submit"]:hover {
  background-color: var(--devise-primary-hover);
}

.devise-actions input[type="submit"]:disabled {
  background-color: var(--devise-disabled);
  cursor: not-allowed;
}

.devise-actions input[type="submit"]:disabled:hover {
  background-color: var(--devise-disabled);
}

.devise-remember {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.devise-remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--devise-primary);
}

.devise-remember label {
  font-size: 14px;
  font-weight: 400;
  color: var(--devise-text-muted);
  cursor: pointer;
  margin: 0;
}

@media (max-width: 640px) {
  .devise-body {
    padding-top: 40px;
  }

  .devise-logo-wrap {
    width: min(220px, 100%);
    margin-bottom: 44px;
  }

  .devise-card {
    max-width: 100%;
    padding: 28px 20px 24px;
  }

  .devise-title {
    font-size: 28px;
    margin-bottom: 24px;
  }
}

.devise-flash {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  max-width: 90%;
}

.devise-notice {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.devise-alert {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.devise-error-messages {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.devise-error-messages ul {
  margin: 0;
  padding-left: 20px;
}

.devise-error-messages li {
  margin-bottom: 4px;
}

/* ===== サインアップ専用スタイル ===== */

.signup-card {
  max-width: 560px;
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.signup-card .devise-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin: 0 0 32px;
}

/* フォーム全体の縦間隔 */
.devise-signup-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* フィールド共通（labelとinputを縦に並べる） */
.devise-signup-form .devise-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

/* label */
.devise-signup-form .devise-field label,
.signup-legend {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1.4;
  margin-bottom: 0;
  padding: 0;
}

/* 必須アスタリスク */
.signup-required {
  color: #dc2626;
  font-size: 14px;
  line-height: 1;
}

/* テキスト・メール・パスワード入力欄 */
.devise-signup-form .devise-field input[type="text"],
.devise-signup-form .devise-field input[type="email"],
.devise-signup-form .devise-field input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 14px;
  color: #333;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #fff;
  height: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.devise-signup-form .devise-field input::placeholder {
  color: #9ca3af;
}

.devise-signup-form .devise-field input[type="text"]:focus,
.devise-signup-form .devise-field input[type="email"]:focus,
.devise-signup-form .devise-field input[type="password"]:focus {
  outline: none;
  border-color: #004D40;
  box-shadow: 0 0 0 2px rgba(0, 77, 64, 0.15);
}

/* fieldset */
.signup-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ラジオボタン群 */
.signup-radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.signup-radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.signup-radio-row input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #004D40;
}

.signup-radio-label {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
  user-select: none;
}

/* 選手検索 UI（保護者登録フォーム） */
.player-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.player-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.player-search__chips:empty {
  display: none;
}

.player-search__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  background-color: #e6f0ee;
  border: 1px solid #b8d6d0;
  border-radius: 16px;
  font-size: 13px;
  color: #004D40;
  line-height: 1.2;
}

.player-search__chip-label {
  white-space: nowrap;
}

.player-search__chip-remove {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  color: #004D40;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.player-search__chip-remove:hover {
  background-color: rgba(0, 77, 64, 0.12);
}

.player-search__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 14px;
  color: #333;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #fff;
  height: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.player-search__input::placeholder {
  color: #9ca3af;
}

.player-search__input:focus {
  outline: none;
  border-color: #004D40;
  box-shadow: 0 0 0 2px rgba(0, 77, 64, 0.15);
}

.player-search__candidates {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #fff;
  max-height: 240px;
  overflow-y: auto;
}

.player-search__candidate {
  padding: 10px 14px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  line-height: 1.4;
}

.player-search__candidate:hover {
  background-color: #f3f4f6;
}

.player-search__empty {
  padding: 10px 14px;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.4;
}

/* 送信ボタン */
.devise-signup-form .devise-actions {
  margin-bottom: 0;
  margin-top: 8px;
  padding-top: 8px;
}

.devise-signup-form .devise-actions input[type="submit"] {
  width: auto;
  padding: 10px 20px;
  height: auto;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  background-color: #004D40;
  border: 1px solid #004D40;
}

.devise-signup-form .devise-actions input[type="submit"]:hover {
  background-color: #00382e;
}

.signup-login-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #525252;
}

.signup-login-link a {
  color: #1165EF;
  text-decoration: none;
}

.signup-login-link a:hover {
  text-decoration: underline;
}

/* 都道府県プルダウン */
.signup-select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 14px;
  color: #333;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #fff;
  height: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.signup-select:focus {
  outline: none;
  border-color: #004D40;
  box-shadow: 0 0 0 2px rgba(0, 77, 64, 0.15);
}

/* ===== パスワードリセット専用スタイル ===== */

.devise-body--reset {
  align-items: flex-start;
  padding-top: 80px;
  background-color: #fff;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
}

.reset-logo-wrap {
  width: 140px;
  margin: 0 auto 64px;
}

.reset-logo-image {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.reset-card {
  width: 100%;
  max-width: 428px;
  box-sizing: border-box;
  padding: 32px;
  background-color: #fff;
  border: 1px solid #eef2f6;
  border-radius: 10px;
}

.reset-title {
  margin: 0 0 24px;
  font-size: 30px;
  font-weight: 600;
  line-height: 30px;
  color: #0d121c;
}

.reset-description {
  margin: 0 0 24px;
  font-size: 16px;
  font-weight: 400;
  line-height: 22.4px;
  color: #6c7684;
}

.reset-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 22.4px;
  color: #4b5565;
}

.reset-required {
  margin-left: 4px;
  color: #f00;
}

.reset-field + .reset-field {
  margin-top: 20px;
}

.reset-field input[type="email"],
.reset-field input[type="password"] {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  padding: 0 16px;
  font-size: 14px;
  font-family: inherit;
  color: #3d3d3d;
  background-color: #fff;
  border: 1px solid #eef2f6;
  border-radius: 3px;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.reset-field input[type="email"]:focus,
.reset-field input[type="password"]:focus {
  outline: none;
  border-color: var(--devise-primary);
}

.reset-field-note {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  color: #6c7684;
}

.reset-actions {
  margin-top: 24px;
}

.reset-actions input[type="submit"] {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  font-family: inherit;
  color: #fff;
  background-color: var(--devise-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reset-actions input[type="submit"]:hover {
  background-color: var(--devise-primary-hover);
}

.reset-actions input[type="submit"]:disabled,
.reset-actions input[type="submit"]:disabled:hover {
  background-color: #e3e8ef;
  cursor: not-allowed;
}

.reset-signin-link {
  margin: 24px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  line-height: 22.4px;
  color: #6c7684;
}

.reset-signin-link a {
  color: #00f;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .devise-body--reset {
    padding-top: 80px;
    padding-left: 0;
    padding-right: 0;
  }

  .reset-logo-wrap {
    margin-bottom: 28px;
  }

  .reset-card {
    max-width: none;
    padding: 40px 16px 32px;
    border: none;
    border-radius: 0;
  }

  .reset-title {
    margin-bottom: 40px;
    font-size: 24px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
  }

  .reset-description {
    margin-bottom: 16px;
  }

  .reset-signin-link {
    margin-top: 16px;
  }
}
