/* MyStay Portal — design system */
:root {
  --ms-bg: #f7f2ea;
  --ms-surface: #ffffff;
  --ms-text: #1c1917;
  --ms-text-muted: #78716c;
  --ms-accent: #b8952a;
  --ms-accent-fg: #ffffff;
  --ms-accent-light: #f0e6c8;
  --ms-border: #e5ddd0;
  --ms-blue-deep: #1a3a6b;
  --ms-error: #b91c1c;
  --ms-success: #15803d;
  --ms-radius: 16px;
  --ms-radius-sm: 10px;
  --ms-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
  --ms-font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ms-font-body:
    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body.ms-body {
  background: var(--ms-bg);
  color: var(--ms-text);
  font-family: var(--ms-font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--ms-text);
  text-decoration: none;
}

/* Layout shell */
.ms-portal {
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 16px 40px;
  position: relative;
}
.ms-screen {
  display: block;
  animation: ms-fade-up 0.28s ease both;
}
.ms-screen[hidden] {
  display: none;
}

@keyframes ms-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ms-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}
@keyframes ms-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ms-shimmer {
  0% {
    background-position: 160% 0;
  }
  100% {
    background-position: -160% 0;
  }
}

/* ===== Screen 1: Language ===== */
.ms-screen-lang {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
.ms-lang-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ms-lang-card {
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 32px 22px;
  font-family: var(--ms-font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--ms-text);
  box-shadow: var(--ms-shadow);
  transition:
    transform 0.12s ease,
    background 0.2s ease;
  min-height: 96px;
}
.ms-lang-card:active {
  transform: scale(0.97);
  background: var(--ms-accent-light);
}

/* ===== Screen 2: Room entry ===== */
.ms-screen-room {
  padding-top: 48px;
}
.ms-room-header {
  text-align: center;
  margin-bottom: 28px;
}
.ms-logo-slot img {
  max-height: 64px;
  margin: 0 auto 18px;
}
.ms-room-welcome {
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 6px;
}
.ms-room-hint {
  margin: 0;
  color: var(--ms-text-muted);
  font-size: 14px;
}
.ms-keypad-wrap {
  margin-top: 8px;
}
.ms-display {
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius-sm);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 34px;
  letter-spacing: 0.18em;
  color: var(--ms-text);
  margin-bottom: 14px;
}
.ms-error {
  background: #fff;
  border: 1px solid var(--ms-error);
  color: var(--ms-error);
  border-radius: var(--ms-radius-sm);
  padding: 10px 14px;
  text-align: center;
  font-size: 14px;
  margin-bottom: 14px;
}
.ms-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  justify-items: center;
}
.ms-keypad.is-shake {
  animation: ms-shake 0.35s ease;
}
.ms-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ms-surface);
  border: 2px solid var(--ms-border);
  font-family: var(--ms-font-body);
  font-size: 24px;
  font-weight: 500;
  color: var(--ms-text);
  transition:
    transform 0.12s ease,
    background 0.2s ease;
}
.ms-key:active {
  transform: scale(0.94);
  background: var(--ms-accent-light);
}
.ms-key-back,
.ms-key-ok {
  font-size: 20px;
  font-weight: 600;
}
.ms-key-back {
  color: var(--ms-text-muted);
}
.ms-key-back::before {
  content: "⌫";
}
.ms-key-ok {
  background: var(--ms-accent);
  border-color: var(--ms-accent);
  color: var(--ms-accent-fg);
}
.ms-key-ok::before {
  content: "✓";
}

/* ===== Screen 3: Dashboard ===== */
.ms-screen-dash {
  padding-top: 32px;
}
.ms-dash-header {
  text-align: center;
  margin-bottom: 18px;
}
.ms-dash-title {
  font-family: var(--ms-font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
}
.ms-dash-room {
  margin: 0;
  color: var(--ms-text-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ms-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ms-card {
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  box-shadow: var(--ms-shadow);
  padding: 22px;
  opacity: 0;
  animation: ms-card-in 0.35s ease forwards;
}
.ms-card-title {
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ms-card-title svg {
  width: 20px;
  height: 20px;
  color: var(--ms-accent);
}
.ms-skeleton-card {
  min-height: 116px;
}
.ms-skeleton {
  display: block;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(184, 149, 42, 0.08) 0%,
    rgba(184, 149, 42, 0.18) 40%,
    rgba(184, 149, 42, 0.08) 80%
  );
  background-size: 220% 100%;
  animation: ms-shimmer 1.1s ease-in-out infinite;
}
.ms-skeleton-title {
  width: 46%;
  height: 18px;
  margin-bottom: 18px;
}
.ms-skeleton-line {
  width: 100%;
  height: 14px;
  margin-bottom: 12px;
}
.ms-skeleton-line.short {
  width: 62%;
}
.ms-skeleton-row {
  height: 34px;
  margin-bottom: 10px;
}

/* WiFi card */
.ms-wifi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ms-wifi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ms-text-muted);
}
.ms-wifi-value {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 18px;
  color: var(--ms-text);
  word-break: break-all;
}
.ms-wifi-hint {
  font-family: var(--ms-font-body);
  font-weight: 600;
  letter-spacing: 0;
}
.ms-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ms-bg);
  border: 1px solid var(--ms-border);
  transition:
    transform 0.12s ease,
    background 0.2s ease;
}
.ms-icon-btn:active {
  transform: scale(0.94);
  background: var(--ms-accent-light);
}
.ms-icon-btn svg {
  width: 18px;
  height: 18px;
  color: var(--ms-text);
}
.ms-icon-btn.is-success svg {
  color: var(--ms-success);
}

/* Weather */
.ms-weather-card {
  min-height: 88px;
}
.ms-weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.ms-weather-city {
  font-weight: 600;
  font-size: 16px;
}
.ms-weather-desc,
.ms-weather-muted {
  color: var(--ms-text-muted);
  font-size: 14px;
  margin: 4px 0 0;
}
.ms-weather-temp {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 34px;
  line-height: 1;
  color: var(--ms-blue-deep);
  white-space: nowrap;
}
.ms-weather-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ms-border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ms-text-muted);
  font-size: 13px;
}
.ms-weather-meta strong {
  color: var(--ms-text);
}

/* Schedule rows */
.ms-sched-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--ms-border);
}
.ms-sched-row:last-child {
  border-bottom: 0;
}
.ms-sched-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ms-sched-left svg {
  width: 18px;
  height: 18px;
  color: var(--ms-accent);
}
.ms-sched-time {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--ms-text);
}

/* Accordion (rules) */
.ms-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--ms-text);
}
.ms-acc-head .ms-chev {
  transition: transform 0.25s ease;
  color: var(--ms-text-muted);
}
.ms-card.is-open .ms-acc-head .ms-chev {
  transform: rotate(180deg);
}
.ms-acc-body {
  display: none;
  padding-top: 14px;
  color: var(--ms-text);
  white-space: pre-wrap;
  line-height: 1.6;
}
.ms-card.is-open .ms-acc-body {
  display: block;
}

/* Local info rows */
.ms-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ms-border);
}
.ms-info-row:last-child {
  border-bottom: 0;
}
.ms-info-row svg {
  width: 18px;
  height: 18px;
  color: var(--ms-accent);
  flex-shrink: 0;
}
.ms-info-text {
  font-size: 15px;
  color: var(--ms-text);
}
.ms-info-text small {
  display: block;
  color: var(--ms-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
a.ms-info-row {
  color: var(--ms-text);
}

/* Buttons (CTA) */
.ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border-radius: var(--ms-radius);
  font-family: var(--ms-font-body);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.02em;
  transition:
    transform 0.12s ease,
    background 0.2s ease;
  text-align: center;
}
.ms-btn:active {
  transform: scale(0.97);
}
.ms-btn-primary {
  background: var(--ms-accent);
  color: var(--ms-accent-fg);
  border: 1px solid var(--ms-accent);
}
.ms-btn-secondary {
  background: var(--ms-surface);
  color: var(--ms-text);
  border: 1.5px solid var(--ms-border);
}
.ms-btn svg {
  width: 18px;
  height: 18px;
}

/* Modal */
.ms-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(28, 25, 23, 0.48);
  animation: ms-fade-up 0.18s ease both;
}
.ms-modal-backdrop.is-leaving {
  animation: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.ms-modal {
  width: min(100%, 420px);
  background: var(--ms-surface);
  color: var(--ms-text);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  padding: 24px;
  text-align: center;
}
.ms-modal-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ms-accent-light);
  color: var(--ms-accent);
  margin-bottom: 14px;
}
.ms-modal-icon svg {
  width: 24px;
  height: 24px;
}
.ms-modal h2 {
  font-family: var(--ms-font-display);
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 10px;
}
.ms-modal p {
  margin: 0 0 20px;
  color: var(--ms-text-muted);
}

/* Reclamation form */
.ms-form .ms-field {
  margin-bottom: 12px;
}
.ms-form label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ms-text-muted);
  margin-bottom: 6px;
}
.ms-form input,
.ms-form select,
.ms-form textarea {
  width: 100%;
  background: var(--ms-bg);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ms-text);
  min-height: 48px;
}
.ms-form textarea {
  min-height: 120px;
  resize: vertical;
}
.ms-form input:focus,
.ms-form select:focus,
.ms-form textarea:focus {
  outline: 2px solid var(--ms-accent);
  outline-offset: 1px;
  border-color: var(--ms-accent);
}
.ms-counter {
  font-size: 12px;
  color: var(--ms-text-muted);
  text-align: right;
  margin-top: 4px;
}
.ms-form-success {
  padding: 24px 8px;
  text-align: center;
  color: var(--ms-success);
}
.ms-form-success svg {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  display: block;
}

/* Footer return */
.ms-dash-footer {
  margin-top: 24px;
  text-align: center;
}
.ms-return-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ms-text-muted);
  font-size: 14px;
  padding: 10px;
}
.ms-return-link svg {
  width: 14px;
  height: 14px;
}

:focus-visible {
  outline: 2px solid var(--ms-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
 * Homepage (root domain)
 * ============================================================ */
body.ms-home {
  font-family: var(--ms-font-body);
  color: #fff;
}
.ms-home-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.ms-home-main {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ms-home-logo {
  max-width: 280px;
  width: 60vw;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.25));
}
.ms-home-wordmark {
  font-family: var(--ms-font-display);
  font-size: 48px;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Waves */
.ms-wave {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 55vh;
  bottom: -5vh;
}
.ms-wave-1 {
  animation: ms-wave-move 12s ease-in-out infinite alternate;
}
.ms-wave-2 {
  animation: ms-wave-move 16s ease-in-out infinite alternate-reverse;
  bottom: -10vh;
}
.ms-wave-3 {
  animation: ms-wave-move 20s ease-in-out infinite alternate;
  bottom: -15vh;
}
@keyframes ms-wave-move {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-30px);
  }
}

/* Particles */
.ms-particles {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.35) 1.5px,
    transparent 1.5px
  );
  background-size: 38px 38px;
  animation: ms-particles-pulse 6s ease-in-out infinite;
}
@keyframes ms-particles-pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.6;
  }
}

/* Pulse */
.ms-pulse {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  animation: ms-pulse-breathe 5s ease-in-out infinite;
}
@keyframes ms-pulse-breathe {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}
