@charset "UTF-8";

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/lato-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/lato-latin-700-normal.woff2") format("woff2");
}

/* ================================
   Reset CSS
   ================================ */

html,
body,
div,
span,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
abbr,
address,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
samp,
small,
strong,
sub,
sup,
var,
b,
i,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
  background: transparent;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

html {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100%;
  background-color: var(--page-bg);
  color: var(--text-color);
  font-size: 14px;
  font-family: var(--app-font-sans);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100%;
  line-height: 1;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-color);
  background-color: var(--page-bg);
  font-family: var(--app-font-sans);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

ul,
ol {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: "";
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

input,
button,
textarea,
select {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  box-shadow: none;
  background-clip: padding-box;
  outline: none;
}

input::-ms-clear,
input::-ms-reveal,
input::-ms-expand {
  display: none;
  width: 0;
  height: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

img,
svg {
  max-width: 100%;
  vertical-align: middle;
}

[hidden] {
  display: none !important;
}

/* ================================
   Global Variables
   ================================ */

:root {
  --header-h: 56px;
  --page-bg: #f0f4f8;
  --header-bg: #f0f4f8;
  --text-color: #333333;
  --brand: #4f8bc2;
  --danger: #d94f4f;
  --theme-orange: #e58e26;
  --theme-yellow: #f2c84b;
  --theme-green: #6bab7d;
  --theme-navy: #2d4e72;
  --theme-purple: #8d70b9;
  --row-gap: 32px;
  --app-font-sans: "Lato",
                   "Hiragino Kaku Gothic ProN",
                   "Hiragino Sans",
                   "Noto Sans JP",
                   Meiryo,
                   system-ui,
                   -apple-system,
                   BlinkMacSystemFont,
                   "Segoe UI",
                   Roboto,
                   "Helvetica Neue",
                   Arial,
                   sans-serif;
}

/* ================================
   SVG Mask Icons
   ================================ */

.svg-mask-icon {
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: inherit;
  background-color: currentColor;
  -webkit-mask-image: var(--icon-mask);
  mask-image: var(--icon-mask);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.icon-settings {
  --icon-mask: url("/icons/material-symbols-sharp/settings_wght200gradN25_24px.svg");
}

.icon-calculate {
  --icon-mask: url("/icons/material-symbols-sharp/calculate_wght200gradN25_24px.svg");
}

.icon-article {
  --icon-mask: url("/icons/material-symbols-sharp/article_wght200gradN25_24px.svg");
}

.icon-monitoring {
  --icon-mask: url("/icons/material-symbols-sharp/monitoring_wght200gradN25_24px.svg");
}

.icon-spot {
  --icon-mask: url("/icons/material-symbols-sharp/emoji_transportation_wght200gradN25_24px.svg");
}

.icon-logout {
  --icon-mask: url("/icons/material-symbols-sharp/logout_wght200gradN25_24px.svg");
}

.icon-lock {
  --icon-mask: url("/icons/material-symbols-sharp/lock_wght200gradN25_24px.svg");
}

.icon-lock-open {
  --icon-mask: url("/icons/material-symbols-sharp/lock_open_wght200gradN25_24px.svg");
}

.icon-visibility {
  --icon-mask: url("/icons/material-symbols-sharp/visibility_wght200gradN25_24px.svg");
}

.icon-visibility-off {
  --icon-mask: url("/icons/material-symbols-sharp/visibility_off_wght200gradN25_24px.svg");
}

.icon-weather-sunny {
  --icon-mask: url("/icons/material-symbols-sharp/sunny_wght200gradN25_24px.svg");
}

.icon-weather-cloudy {
  --icon-mask: url("/icons/material-symbols-sharp/cloud_wght200gradN25_24px.svg");
}

.icon-weather-rainy {
  --icon-mask: url("/icons/material-symbols-sharp/rainy_wght200gradN25_24px.svg");
}

.icon-weather-snowy {
  --icon-mask: url("/icons/material-symbols-sharp/weather_snowy_wght200gradN25_24px.svg");
}

/* ================================
   Screen Reader only
   ================================ */

.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================
   Login Layout
   ================================ */

.login-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100svh;
  box-sizing: border-box;
  overflow: hidden;
  background-color: var(--page-bg);
  color: var(--text-color);
  overscroll-behavior: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.login-panel {
  width: 70%;
  max-width: 534px;
  min-width: 260px;
  margin: 0 auto;
  padding: 0;
  text-align: center;
  transform: translateY(-38px);
}

.login-lock-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  color: var(--brand);
  transition:
    color 0.25s ease,
    transform 0.25s ease;
}

.login-lock-icon::before,
.login-lock-icon::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.login-lock-icon::before {
  border: 1px solid rgba(79, 139, 194, 0.28);
  transform: scale(0.74);
}

.login-lock-icon::after {
  background:
    radial-gradient(
      circle,
      rgba(79, 139, 194, 0.22) 0%,
      rgba(79, 139, 194, 0.12) 38%,
      rgba(79, 139, 194, 0) 70%
    );
  transform: scale(0.68);
}

.login-lock-icon.is-open {
  color: var(--brand);
  transform: scale(1.04);
}

.login-lock-svg {
  position: relative;
  z-index: 1;
  width: 60px;
  height: 60px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.login-field {
  position: relative;
  width: 100%;
  margin: 0;
  text-align: left;
}

.login-field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand);
  pointer-events: none;
}

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

.password-wrap::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 2px;
  z-index: 1;
  width: 48px;
  background: var(--page-bg);
  pointer-events: none;
}

.login-input {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 10px 0;
  color: var(--text-color);
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  background-color: var(--page-bg);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: left;
  box-shadow: none;
  background-clip: padding-box;
  caret-color: var(--brand);
}

.password-input {
  padding-right: 48px;
}

.login-input::placeholder {
  color: var(--brand);
  opacity: 1;
  text-align: left;
}

.login-input:focus {
  border-bottom-color: transparent;
  box-shadow: none;
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-color) !important;
  background-color: var(--page-bg) !important;
  box-shadow: 0 0 0 1000px var(--page-bg) inset !important;
  transition: background-color 99999s ease-out, color 99999s ease-out;
  caret-color: var(--brand);
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--brand);
  border: none;
  outline: none;
  background: transparent;
  transform: translateY(-50%);
}

.password-svg-icon {
  width: 24px;
  height: 24px;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.password-toggle:disabled {
  cursor: default;
  opacity: 0.55;
}

/* ================================
   Login Motion
   ================================ */

.login-page.is-success-login .login-lock-icon::before {
  animation: unlock-ring 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.login-page.is-success-login .login-lock-icon::after {
  animation: unlock-glow 680ms ease-out forwards;
}

.login-page.is-success-login .login-lock-svg {
  animation: unlock-pop 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.login-page.is-success-login .login-form {
  animation: login-form-success-out 620ms 120ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.login-panel.is-login-error {
  animation: login-error-shake 320ms ease both;
}

@keyframes unlock-ring {
  0% {
    opacity: 0;
    transform: scale(0.74);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.68);
  }
}

@keyframes unlock-glow {
  0% {
    opacity: 0;
    transform: scale(0.68);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}

@keyframes unlock-pop {
  0% {
    transform: translateY(0) scale(1);
  }

  34% {
    transform: translateY(-2px) scale(1.08);
  }

  100% {
    transform: translateY(0) scale(1.02);
  }
}

@keyframes login-form-success-out {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes login-error-shake {
  0%,
  100% {
    transform: translateY(-38px) translateX(0);
  }

  20% {
    transform: translateY(-38px) translateX(-5px);
  }

  40% {
    transform: translateY(-38px) translateX(5px);
  }

  60% {
    transform: translateY(-38px) translateX(-3px);
  }

  80% {
    transform: translateY(-38px) translateX(3px);
  }
}

/* ================================
   Toast Message
   ================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  width: min(86vw, 390px);
  min-height: 0;
  padding: 10px 15px 9px;
  color: var(--danger);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(45, 78, 114, 0.15);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 120%);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-success {
  color: var(--brand);
}

/* ================================
   Logout Dialog
   ================================ */

.logout-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(24px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overscroll-behavior: contain;
  transition:
    opacity 0.22s ease,
    visibility 0s linear 0.22s;
}

.logout-dialog-overlay.is-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.logout-dialog-card {
  width: min(86vw, 320px);
  padding: 18px 18px 16px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(45, 78, 114, 0.18);
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

.logout-dialog-overlay.is-show .logout-dialog-card {
  transform: translateY(0) scale(1);
}

.logout-dialog-text {
  margin: 0 0 16px;
  color: var(--text-color);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

.logout-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logout-dialog-button {
  flex: 1 1 0;
  min-height: 44px;
  padding: 8px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
}

.logout-dialog-button-cancel {
  color: var(--brand);
  background: rgba(79, 139, 194, 0.1);
}

.logout-dialog-button-confirm {
  color: #ffffff;
  background: var(--brand);
}

.logout-dialog-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ================================
   App Logged-in Layout
   ================================ */

.app-page {
  position: relative;
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-color);
  background-color: var(--page-bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-page::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  box-sizing: border-box;
  background-color: var(--header-bg);
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1px, 1vw, 5px);
  width: 100%;
  height: 100%;
  padding:
    0
    max(7px, env(safe-area-inset-right))
    0
    max(7px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.nav-icon-link,
.nav-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: var(--brand);
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}

.nav-svg-icon {
  width: 28px;
  height: 28px;
}

.nav-icon-link:focus-visible,
.nav-icon-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.nav-icon-link[aria-current="page"] {
  background: rgba(79, 139, 194, 0.1);
}

.nav-logout-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
}

.app-content {
  min-height: calc(100svh - var(--header-h) - env(safe-area-inset-top));
  box-sizing: border-box;
  padding:
    calc(var(--header-h) + env(safe-area-inset-top) + 14px)
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.page-title {
  margin: 0;
  color: var(--text-color);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

/* ================================
   Error Page
   ================================ */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 320px;
  min-height: 100svh;
  box-sizing: border-box;
  padding:
    max(24px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  color: var(--text-color);
  background: var(--page-bg);
}

.error-card {
  width: min(100%, 420px);
  box-sizing: border-box;
  padding: 30px 24px 26px;
  border: 1px solid rgba(79, 139, 194, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 34px rgba(45, 78, 114, 0.08);
  text-align: center;
}

.error-code {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
}

.error-title {
  margin: 0;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
}

.error-message {
  margin: 12px 0 0;
  color: #59636d;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
}

.error-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 136px;
  min-height: 44px;
  box-sizing: border-box;
  margin-top: 22px;
  padding: 10px 18px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  color: #ffffff;
  background: var(--brand);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  touch-action: manipulation;
}

.error-home-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* ================================
   State
   ================================ */

.login-panel.is-sending .login-input {
  pointer-events: none;
}

body.is-dialog-open {
  overflow: hidden;
}

body.is-dialog-open .app-page {
  overflow: hidden;
}

/* ================================
   Reduced Motion
   ================================ */

@media (prefers-reduced-motion: reduce) {
  .login-page.is-success-login .login-lock-icon::before,
  .login-page.is-success-login .login-lock-icon::after,
  .login-page.is-success-login .login-lock-svg,
  .login-page.is-success-login .login-form,
  .login-panel.is-login-error {
    animation: none;
  }

  .login-lock-icon,
  .login-field::after,
  .toast,
  .logout-dialog-overlay,
  .logout-dialog-card {
    transition-duration: 0.01ms;
  }
}

/* ================================
   Responsive
   ================================ */

@media (max-height: 520px) {
  .login-panel {
    transform: translateY(-24px);
  }

  @keyframes login-error-shake {
    0%,
    100% {
      transform: translateY(-24px) translateX(0);
    }

    20% {
      transform: translateY(-24px) translateX(-5px);
    }

    40% {
      transform: translateY(-24px) translateX(5px);
    }

    60% {
      transform: translateY(-24px) translateX(-3px);
    }

    80% {
      transform: translateY(-24px) translateX(3px);
    }
  }
}

@media (max-width: 480px) {
  .login-panel {
    width: 70%;
    min-width: 230px;
    transform: translateY(-34px);
  }

  .login-lock-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
  }

  .login-lock-svg {
    width: 60px;
    height: 60px;
  }

  .login-form {
    gap: 20px;
  }

  .login-input {
    padding: 10px 0;
    font-size: 16px;
  }

  .toast {
    width: min(86vw, 360px);
    padding: 9px 14px 8px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
  }

  .logout-dialog-card {
    width: min(86vw, 300px);
    padding: 17px 16px 15px;
    border-radius: 13px;
  }

  .logout-dialog-text {
    margin-bottom: 15px;
    font-size: 14px;
  }

  .logout-dialog-button {
    min-height: 44px;
    border-radius: 9px;
    font-size: 13px;
  }

  @keyframes login-error-shake {
    0%,
    100% {
      transform: translateY(-34px) translateX(0);
    }

    20% {
      transform: translateY(-34px) translateX(-5px);
    }

    40% {
      transform: translateY(-34px) translateX(5px);
    }

    60% {
      transform: translateY(-34px) translateX(-3px);
    }

    80% {
      transform: translateY(-34px) translateX(3px);
    }
  }
}

@media (max-width: 360px) {
  .login-panel {
    width: 76%;
    min-width: 220px;
  }

  .app-nav {
    gap: 0;
  }

  .nav-svg-icon {
    width: 25px;
    height: 25px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .nav-icon-link:hover,
  .nav-icon-button:hover {
    background: rgba(79, 139, 194, 0.08);
  }

  .logout-dialog-button-cancel:hover {
    background: rgba(79, 139, 194, 0.16);
  }

  .logout-dialog-button-confirm:hover {
    background: #467faf;
  }

  .error-home-link:hover {
    background: #467faf;
  }
}
