:root {
  --tethys-accent: #007ca6;
  --tethys-accent-hover: #006f96;
  --tethys-text: #2b2f36;
  --tethys-input-text: #1f2329;
  --tethys-placeholder: #737a84;
  --tethys-border: #c7ccd3;
  --tethys-card: #fff;
}

* { box-sizing: border-box; }

html,
html.login-pf { min-height: 100%; }

body.tethys-page {
  min-height: 100vh;
  margin: 0;
  padding: 4rem 1rem;
  position: relative;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tethys-text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  background: radial-gradient(120% 120% at 50% 0%, #6cb8dd 0%, #2f83b0 45%, #0f3f5e 100%);
}

.tethys-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(100% 90% at 50% 45%, transparent 55%, rgba(6, 26, 40, .65) 100%);
}

.tethys-center {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tethys-card {
  width: 100%;
  max-width: 720px;
  padding: 2.5rem 3.5rem;
  border-radius: 8px;
  background: var(--tethys-card);
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .55);
}

.tethys-card__inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.tethys-auth {
  flex: 1 1 auto;
  min-width: 0;
}

.tethys-header { position: relative; }

.tethys-header h1 {
  margin: 0 0 2rem;
  padding: 0;
  color: var(--tethys-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  text-align: left;
}

.tethys-title,
.tethys-instruction { display: block; }

.tethys-locale {
  position: absolute;
  top: -1.5rem;
  right: 0;
  z-index: 2;
}

.tethys-locale button {
  padding: .25rem .5rem;
  border: 0;
  color: #36515f;
  background: transparent;
  cursor: pointer;
}

.tethys-locale ul {
  min-width: 8rem;
  margin: .25rem 0 0;
  padding: .25rem 0;
  position: absolute;
  right: 0;
  list-style: none;
  border: 1px solid var(--tethys-border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .16);
}

.tethys-locale li a {
  display: block;
  padding: .4rem .75rem;
  color: var(--tethys-text);
  text-decoration: none;
}

.tethys-attempted-user {
  display: flex;
  justify-content: space-between;
  margin: -1rem 0 1.5rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  background: #eef7fa;
}

.tethys-attempted-user a,
.tethys-options a,
#kc-info a,
#kc-social-providers a { color: #006f96; }

.tethys-alert {
  margin: 0 0 1.25rem;
  padding: .65rem .8rem;
  border: 1px solid #9eb7c2;
  border-radius: 6px;
  background: #eef7fa;
  font-size: 14px;
  line-height: 1.5;
}

.tethys-alert--error { border-color: #c83c3c; color: #842525; background: #fff1f1; }
.tethys-alert--warning { border-color: #a66b00; color: #6f4800; background: #fff8e6; }
.tethys-alert--success { border-color: #25804b; color: #195b35; background: #effbf3; }

.tethys-form { margin: 0; }

.tethys-field {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tethys-field > label {
  flex: 0 0 2rem;
  padding-top: .55rem;
  color: var(--tethys-text);
  font-size: 15px;
  font-weight: 500;
}

.tethys-field--otp > label { flex-basis: 8rem; }

.tethys-control {
  flex: 1 1 auto;
  min-width: 0;
}

.tethys-control > input,
.tethys-password > input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: .5rem .75rem;
  border: 1px solid var(--tethys-border);
  border-radius: 6px;
  outline: none;
  color: var(--tethys-input-text);
  background: #fff;
  font: inherit;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.tethys-control input::placeholder,
.tethys-password input::placeholder { color: var(--tethys-placeholder); opacity: 1; }

.tethys-control input:focus,
.tethys-password input:focus {
  border-color: var(--tethys-accent);
  box-shadow: 0 0 0 3px rgba(0, 124, 166, .25);
}

.tethys-password { position: relative; }
.tethys-password > input { padding-right: 2.75rem; }

.tethys-password-toggle {
  width: 2.5rem;
  height: 36px;
  position: absolute;
  top: 1px;
  right: 1px;
  border: 0;
  border-radius: 0 5px 5px 0;
  color: #4d5960;
  background: transparent;
  cursor: pointer;
}

.tethys-field-error {
  display: block;
  margin-top: .35rem;
  color: #842525;
  font-size: 13px;
  line-height: 1.4;
}

.tethys-options {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: .25rem 0 1.25rem 3rem;
  font-size: 13px;
}

.tethys-actions {
  display: flex;
  justify-content: flex-start;
  padding-left: 3rem;
  margin-top: 2rem;
}

.tethys-submit {
  min-width: 165px;
  padding: .625rem 3rem;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--tethys-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease;
}

.tethys-submit:hover { background: var(--tethys-accent-hover); }

.tethys-submit:focus-visible,
.tethys-password-toggle:focus-visible,
.tethys-link-button:focus-visible,
.tethys-locale button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--tethys-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 124, 166, .30);
}

.tethys-mascot {
  flex: 0 0 auto;
  width: 144px;
  height: 144px;
  object-fit: contain;
}

.tethys-link-button {
  margin-top: 1rem;
  padding: 0;
  border: 0;
  color: #006f96;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.tethys-otp-credentials {
  margin: 0 0 1.5rem;
  padding: .75rem;
  border: 1px solid var(--tethys-border);
  border-radius: 6px;
}

.tethys-otp-credentials label { display: block; margin-top: .5rem; }

#kc-info {
  margin-top: 1.25rem;
  font-size: 13px;
}

#kc-social-providers { margin-top: 1.5rem; }
#kc-social-providers h2 { font-size: 14px; }
#kc-social-providers ul { margin: 0; padding: 0; list-style: none; }
#kc-social-providers li + li { margin-top: .5rem; }

@media (max-width: 767px) {
  body.tethys-page { padding: 2rem 1rem; }
  .tethys-card { padding: 2rem 1.5rem; }
  .tethys-card__inner { flex-direction: column; gap: 1.5rem; }
  .tethys-auth { width: 100%; }
  .tethys-mascot { order: 2; }
  .tethys-actions { justify-content: center; padding-left: 0; }
}

@media (max-width: 480px) {
  .tethys-field { display: block; }
  .tethys-field > label { display: block; padding: 0 0 .35rem; }
  .tethys-options { margin-left: 0; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .tethys-control input,
  .tethys-password input,
  .tethys-submit { transition: none; }
}
