:root {
  --waterfoot-bg: #f5f8fb;
  --waterfoot-panel: #ffffff;
  --waterfoot-ink: #102535;
  --waterfoot-muted: #587083;
  --waterfoot-line: #d8e2ea;
  --waterfoot-brand: #104866;
  --waterfoot-brand-strong: #0b344a;
  --waterfoot-accent: #1b7a73;
  --waterfoot-danger-bg: #fff2f2;
  --waterfoot-danger: #9d2e2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--waterfoot-bg);
  color: var(--waterfoot-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--waterfoot-brand);
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--waterfoot-line);
  background: rgba(255, 255, 255, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--waterfoot-ink);
  font-weight: 700;
  text-decoration: none;
}

.brand img,
.auth-logo img {
  display: block;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
  padding: 32px 20px;
}

.auth-panel {
  width: min(100%, 460px);
  border: 1px solid var(--waterfoot-line);
  border-radius: 8px;
  background: var(--waterfoot-panel);
  box-shadow: 0 18px 48px rgba(16, 37, 53, 0.08);
}

.auth-panel {
  padding: 32px;
}

.auth-logo {
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
}

.auth-panel h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.35rem;
}

.muted {
  color: var(--waterfoot-muted);
  line-height: 1.6;
}

.small {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.stacked-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

label {
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--waterfoot-line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--waterfoot-ink);
  font: inherit;
}

input:focus-visible,
button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(27, 122, 115, 0.28);
  outline-offset: 2px;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--waterfoot-brand);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

button:hover {
  background: var(--waterfoot-brand-strong);
}

.text-button {
  min-height: auto;
  border: 1px solid var(--waterfoot-line);
  background: #ffffff;
  color: var(--waterfoot-brand);
  padding: 8px 12px;
}

.text-button:hover {
  background: var(--waterfoot-bg);
  color: var(--waterfoot-brand-strong);
}

.messages {
  width: min(100%, 720px);
  margin: 0 auto 20px;
}

.message {
  border: 1px solid var(--waterfoot-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
  color: var(--waterfoot-ink);
}

.message.error {
  border-color: #f0c4c4;
  background: var(--waterfoot-danger-bg);
  color: var(--waterfoot-danger);
}

.errorlist {
  margin: 0;
  padding-left: 20px;
  color: var(--waterfoot-danger);
}

.dashboard-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.dashboard-embed {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.dashboard-shell--loading .dashboard-embed {
  opacity: 0;
}

.dashboard-shell--ready .dashboard-embed {
  opacity: 1;
  transition: opacity 180ms ease;
}

.dashboard-loading {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(245, 248, 251, 0.96), rgba(255, 255, 255, 0.98)),
    #ffffff;
  color: var(--waterfoot-ink);
}

.dashboard-shell--ready .dashboard-loading {
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.dashboard-loading__panel {
  display: grid;
  justify-items: center;
  width: min(360px, calc(100vw - 48px));
  padding: 28px;
  border: 1px solid var(--waterfoot-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 60px rgba(16, 37, 53, 0.12);
  text-align: center;
}

.dashboard-loading__panel img {
  margin-bottom: 12px;
}

.dashboard-loading__panel h1 {
  margin: 10px 0 6px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.dashboard-loading__panel p {
  min-height: 1.25rem;
  margin: 0;
  color: var(--waterfoot-muted);
  font-size: 0.9rem;
}

.dashboard-loading__pulse {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(27, 122, 115, 0.18);
  border-top-color: var(--waterfoot-accent);
  border-radius: 999px;
  animation: dashboard-spin 900ms linear infinite;
}

.dashboard-loading__bar {
  width: 100%;
  height: 6px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef3;
}

.dashboard-loading__bar span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--waterfoot-brand), var(--waterfoot-accent));
  transition: width 280ms ease;
}

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

.floating-logout {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1000;
}

.floating-logout button {
  min-height: 34px;
  border: 1px solid rgba(216, 226, 234, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--waterfoot-ink);
  box-shadow: 0 8px 24px rgba(16, 37, 53, 0.12);
  padding: 6px 10px;
  font-size: 0.86rem;
}

.floating-logout button:hover {
  background: #ffffff;
  color: var(--waterfoot-brand-strong);
}

.dashboard-empty {
  display: grid;
  width: min(520px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  place-content: center;
  color: var(--waterfoot-ink);
  text-align: center;
}

.dashboard-empty h1 {
  font-size: 1.35rem;
}

@media (max-width: 680px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-panel {
    padding: 24px;
  }

  .floating-logout {
    top: 10px;
    right: 10px;
  }
}
