:root {
  --brand: #ff6a00;
  --bg: #f7f7f7;
  --card: rgba(255, 255, 255, 0.9);
  --text: #3f3027;
  --sub: #74675f;
  --border: rgba(232, 226, 222, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.login-page {
  min-height: 100vh;
  padding: 14px;
}

.login-hero {
  position: relative;
  width: min(500px, 100%);
  min-height: calc(100vh - 28px);
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.12),
      rgba(255, 255, 255, 0.32),
      rgba(255, 255, 255, 0.78)
    ),
    var(--login-bg-url) center top / 100% auto no-repeat;

  box-shadow: 0 18px 48px rgba(80, 55, 40, 0.08);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 15%,
      rgba(255, 255, 255, 0.6),
      transparent 40%
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
  z-index: 0;
}

.brand-area {
  position: relative;
  z-index: 3;
  padding: 24px 30px 0;
  max-width: 390px;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.logo-icon {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-top: -20px;
  margin-left: 20px;
}

.logo-text {
  width: min(240px, 68vw);
  height: auto;
  margin-top: -30px;
}

.sub-copy {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--sub);
}

.pchan-right {
  position: absolute;
  right: -8%;
  top: 40px;
  width: 360px;
  max-height: none;
  object-fit: contain;
  opacity: 0.98;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 18px 36px rgba(65, 45, 35, 0.18));
}

.form-card-wrap {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding: 0;
}

.form-card {
  width: min(500px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 18px 46px rgba(80, 55, 40, 0.12);
  padding: 18px 28px 20px;
  backdrop-filter: blur(6px);
}

.form-card h1 {
  margin: 0 0 18px;
  font-size: 32px;
  display: none;
}

label {
  display: block;
  margin: 9px 0 5px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

input {
  width: 100%;
  border: 1px solid #ddd2ca;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  padding: 11px 13px;
  font-size: 16px;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(80, 55, 40, 0.03);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input:hover {
  border-color: #cdbeb4;
}

input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 55px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #8f847b;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 17px;
  border-radius: 9px;
}

.toggle-password:hover {
  background: rgba(255, 106, 0, 0.07);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

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

.remember-row label {
  margin: 0;
  cursor: pointer;
}

.btn-login {
  width: 100%;
  border: 0;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  padding: 12px 14px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 106, 0, 0.22);
  transition:
    transform 0.15s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.btn-login:hover {
  filter: brightness(1.03);
  box-shadow: 0 10px 22px rgba(255, 106, 0, 0.27);
}

.btn-login:active {
  transform: scale(0.985);
}

/* SSOは第2リリースでは非表示。提供開始時にdisplayを戻す。 */
.divider {
  display: none;
  text-align: center;
  margin: 18px 0;
  color: #a49991;
  position: relative;
}

.divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #e7dfda;
}

.divider span {
  background: rgba(255, 255, 255, 0.9);
  padding: 0 10px;
  position: relative;
}

.btn-sso {
  display: none;
  width: 100%;
  border: 1px solid var(--brand);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand);
  padding: 13px;
  font-size: 20px;
}

.btn-sso:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  margin-top: 12px;
}

.links a {
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.links a:first-child {
  display: block;
  padding: 2px 4px;
}

.links a:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 34px;
  padding: 7px 15px;
  border: 1px solid rgba(255, 106, 0, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(80, 55, 40, 0.05);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

.links a:last-child:hover {
  background: rgba(255, 106, 0, 0.07);
  box-shadow: 0 5px 14px rgba(80, 55, 40, 0.08);
}

.links a:last-child:active {
  transform: scale(0.98);
}

.error {
  margin-bottom: 10px;
  background: #ffebee;
  color: #c62828;
  padding: 10px;
  border-radius: 10px;
}

/* Large desktop: keep the hero compact so the brand, form and character read as one composition. */
@media (min-width: 1400px) and (min-height: 700px) {
  body {
    background:
      radial-gradient(
        circle at 15% 18%,
        rgba(255, 133, 46, 0.08),
        transparent 28%
      ),
      radial-gradient(
        circle at 85% 82%,
        rgba(255, 201, 157, 0.12),
        transparent 30%
      ),
      #f6f4f2;
  }

  .login-page {
    display: grid;
    place-items: center;
    padding: 24px 42px;
  }

  .login-hero {
    width: min(800px, calc(100vw - 140px));
    min-height: min(580px, calc(100vh - 72px));
    margin: 0;
    border: 1px solid rgba(235, 221, 210, 0.9);
    border-radius: 32px;
    background:
      linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.22) 0%,
        rgba(255, 255, 255, 0.06) 52%,
        rgba(255, 255, 255, 0.36) 100%
      ),
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.42)
      ),
      var(--login-bg-url) center / cover no-repeat;
    box-shadow:
      0 28px 64px rgba(73, 48, 33, 0.12),
      0 2px 0 rgba(255, 255, 255, 0.86) inset;
  }

  .hero-overlay {
    background:
      linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.78) 0%,
        rgba(255, 255, 255, 0.34) 38%,
        rgba(255, 255, 255, 0.06) 62%,
        rgba(255, 255, 255, 0.28) 100%
      ),
      radial-gradient(
        circle at 28% 24%,
        rgba(255, 255, 255, 0.82),
        transparent 36%
      );
  }

  .brand-area {
    position: absolute;
    left: 40px;
    top: 20px;
    width: 470px;
    max-width: none;
    padding: 0;
  }

  .brand-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0px;
  }

  .logo-icon {
    width: 136px;
    height: 136px;
    margin: 0;
    flex: 0 0 auto;
  }

  .logo-text {
    width: 290px;
    margin: 6px 0 0 0;
    flex: 0 0 auto;
  }

  .form-card-wrap {
    position: absolute;
    top: 61%;
    left: 215px;
    right: auto;
    width: 390px;
    margin: 0;
    transform: translateY(-50%);
  }

  .pchan-right {
    left: auto;
    right: -60px;
    top: 90px;
    width: 332px;
    opacity: 0.94;
    filter: drop-shadow(0 14px 24px rgba(65, 45, 35, 0.11));
  }

  .form-card {
    width: 100%;
    padding: 26px 32px 24px;
    border: 1px solid rgba(233, 219, 209, 0.94);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
      0 20px 48px rgba(76, 52, 36, 0.16),
      0 1px 0 rgba(255, 255, 255, 0.92) inset;
    backdrop-filter: blur(12px);
  }

  .form-card label {
    margin-top: 11px;
  }

  .form-card input[type="text"],
  .form-card input[type="password"] {
    min-height: 46px;
  }

  .remember-row {
    margin: 16px 0 14px;
  }

  .btn-login {
    min-height: 50px;
  }

  .links {
    margin-top: 15px;
  }
}

/* Medium desktop / ThinkPad: preserve the approved composition at a smaller scale. */
@media (min-width: 560px) and (max-width: 1399px) and (min-height: 560px) {
  body {
    background:
      radial-gradient(circle at 15% 18%, rgba(255, 133, 46, 0.06), transparent 28%),
      radial-gradient(circle at 85% 82%, rgba(255, 201, 157, 0.1), transparent 30%),
      #f6f4f2;
  }

  .login-page {
    display: grid;
    place-items: center;
    padding: 18px 24px;
  }

  .login-hero {
    width: min(720px, calc(100vw - 48px));
    min-height: min(522px, calc(100vh - 36px));
    margin: 0;
    border: 1px solid rgba(235, 221, 210, 0.9);
    border-radius: 28px;
    background:
      linear-gradient(90deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.06) 52%, rgba(255,255,255,.36) 100%),
      linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.42)),
      var(--login-bg-url) center / cover no-repeat;
    box-shadow:
      0 22px 50px rgba(73, 48, 33, 0.11),
      0 2px 0 rgba(255,255,255,.86) inset;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.34) 38%, rgba(255,255,255,.06) 62%, rgba(255,255,255,.28) 100%),
      radial-gradient(circle at 28% 24%, rgba(255,255,255,.82), transparent 36%);
  }

  .brand-area {
    position: absolute;
    left: 34px;
    top: 18px;
    width: 400px;
    max-width: none;
    padding: 0;
  }

  .brand-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .logo-icon {
    width: 116px;
    height: 116px;
    margin: 0;
    flex: 0 0 auto;
  }

  .logo-text {
    width: 247px;
    margin: 5px 0 0 0;
    flex: 0 0 auto;
  }

  .form-card-wrap {
    position: absolute;
    top: 61%;
    left: 183px;
    right: auto;
    width: 332px;
    margin: 0;
    transform: translateY(-50%);
  }

  .pchan-right {
    left: auto;
    right: -50px;
    top: 76px;
    width: 282px;
    opacity: 0.94;
    filter: drop-shadow(0 12px 20px rgba(65,45,35,.1));
  }

  .form-card {
    width: 100%;
    padding: 20px 26px 19px;
    border-radius: 24px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 16px 38px rgba(76,52,36,.14);
    backdrop-filter: blur(10px);
  }

  .form-card label {
    margin-top: 8px;
    font-size: 14px;
  }

  .form-card input[type="text"],
  .form-card input[type="password"] {
    min-height: 42px;
    font-size: 15px;
  }

  .remember-row {
    margin: 12px 0 11px;
    font-size: 14px;
  }

  .btn-login {
    min-height: 46px;
    font-size: 18px;
  }

  .links {
    gap: 7px;
    margin-top: 11px;
  }

  .links a {
    font-size: 13px;
  }
}

@media (max-width: 559px) {
  .login-page {
    padding: 0;
  }

  .login-hero {
    width: 100%;
    border-radius: 0;
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.32),
        rgba(255, 255, 255, 0.78)
      ),
      var(--login-bg-url) center top / 100% auto no-repeat;
  }

  .brand-area {
    padding: 18px 18px 0;
    max-width: 58%;
  }

  .logo-icon {
    width: 180px;
    height: 180px;
    margin-left: 8px;
  }

  .logo-text {
    width: min(200px, 58vw);
    margin-top: -22px;
  }

  .sub-copy {
    font-size: 13px;
    line-height: 1.75;
  }

  .pchan-right {
    width: 80vw;
    top: 60px;
    right: -15%;
  }

  .form-card-wrap {
    margin-top: 6px;
  }

  .form-card {
    width: 100%;
    padding: 18px 16px 20px;
  }

  .form-card h1 {
    font-size: 28px;
  }

  label {
    margin-top: 8px;
    font-size: 14px;
  }

  input {
    padding: 10px 12px;
  }

  .remember-row {
    margin: 13px 0 11px;
    font-size: 14px;
  }

  .btn-login {
    padding: 11px 14px;
    font-size: 18px;
  }

  .links {
    gap: 7px;
    margin-top: 10px;
  }

  .links a {
    font-size: 13px;
  }

  .links a:last-child {
    min-height: 32px;
    padding: 6px 13px;
  }
}