:root {
  color-scheme: light dark;
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.6;
  color: #222;
}

.reset-container {
  width: 100%;
  max-width: 480px;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reset-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.reset-header {
  background-color: #1976d2;
  color: #fff;
  padding: 40px 30px;
  text-align: center;
}

.reset-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.95rem;
  opacity: 0.95;
  font-weight: 400;
}

.reset-form {
  padding: 40px 30px 30px;
}

.description {
  margin-bottom: 24px;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

.field {
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding: 10px 45px 10px 12px;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 18px;
  transition: color 0.2s ease;
  z-index: 1;
}

.password-toggle:hover {
  color: #333;
}

.password-toggle:active {
  opacity: 0.7;
}

.password-toggle i {
  display: inline-block;
  user-select: none;
}

.field input:focus {
  outline: none;
  border-color: #1976d2;
}

.field input::placeholder {
  color: #a0aec0;
}

.reset-button {
  width: 100%;
  background-color: #1976d2;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background-color 0.2s ease;
  margin-top: 8px;
}

.reset-button:hover,
.reset-button:focus-visible {
  background-color: #1565c0;
}

.reset-button:active {
  transform: scale(0.98);
}

.reset-button:disabled {
  background-color: #90a4ae;
  cursor: not-allowed;
  opacity: 0.7;
}

.reset-button:disabled:hover {
  background-color: #90a4ae;
  transform: none;
}

.reset-message {
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  min-height: 20px;
}

.reset-message.error {
  color: #c62828;
}

.reset-message.success {
  color: #2e7d32;
}

.reset-message.info {
  color: #1976d2;
}

.reset-footer {
  padding: 0 30px 30px;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1976d2;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #1565c0;
  text-decoration: underline;
}

/* 成功画面 */
.success-content {
  padding: 40px 30px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background-color: #2e7d32;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
}

.success-content h2 {
  font-size: 1.4rem;
  color: #222;
  margin-bottom: 12px;
}

.success-description {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.login-link-button {
  display: inline-block;
  background-color: #1976d2;
  color: #fff;
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.login-link-button:hover {
  background-color: #1565c0;
}

/* モバイル対応 */
@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .reset-card {
    border-radius: 12px;
  }

  .reset-header {
    padding: 32px 24px;
  }

  .reset-header h1 {
    font-size: 1.3rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .reset-form {
    padding: 32px 24px 24px;
  }

  .field input {
    padding: 12px 14px;
    font-size: 16px; /* スマホでズーム防止 */
  }

  .reset-button {
    padding: 14px;
    font-size: 1rem;
  }

  .reset-footer {
    padding: 0 24px 24px;
  }

  .success-content {
    padding: 32px 24px;
  }

  .success-icon {
    width: 64px;
    height: 64px;
    font-size: 40px;
  }
}

/* タブレット対応 */
@media (min-width: 481px) and (max-width: 768px) {
  .reset-container {
    max-width: 480px;
  }
}

/* 全画面ローディングオーバーレイ */
.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background-color: #fff;
  padding: 32px 48px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.global-loading-content p {
  margin: 0;
  color: #546e7a;
  font-size: 0.95rem;
  font-weight: 500;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e3f2fd;
  border-top-color: #1976d2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

