* {
  box-sizing: border-box;
}

:root {
  --bg: #f4faf8;
  --bg-blue: #f4f9fc;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --border: #dcece7;
  --border-blue: #dceaf2;
  --text: #223f38;
  --text-strong: #183930;
  --muted: #789087;
  --muted-light: #9aaca6;
  --mint: #72cbb2;
  --mint-deep: #4daf92;
  --mint-dark: #2f7966;
  --mint-pale: #edf8f4;
  --blue: #77b9d7;
  --blue-deep: #4e91b2;
  --blue-pale: #eef7fb;
  --danger: #b85f67;
  --success: #438b70;
  --shadow: 0 26px 70px rgba(44, 92, 78, 0.11);
  --shadow-soft: 0 14px 38px rgba(43, 86, 75, 0.08);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(114, 203, 178, 0.17), transparent 27%),
    radial-gradient(circle at 88% 84%, rgba(119, 185, 215, 0.16), transparent 30%),
    linear-gradient(145deg, #fbfefd 0%, var(--bg) 47%, #f1f8fb 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.decor::before,
.decor::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(83, 159, 137, 0.11);
}

.decor::before {
  width: 440px;
  height: 440px;
  top: -165px;
  left: -185px;
}

.decor::after {
  width: 560px;
  height: 560px;
  right: -250px;
  bottom: -245px;
  border-color: rgba(83, 146, 178, 0.10);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px;
}

.auth-shell {
  width: min(600px, 96vw);
  min-height: 650px;
  padding: 54px 52px 38px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition:
    width 0.25s ease,
    min-height 0.25s ease,
    padding 0.25s ease;
}

.auth-shell.app-shell {
  width: min(1050px, 96vw);
  min-height: min(760px, calc(100vh - 44px));
  padding: 26px 32px 30px;
}

.brand {
  margin-bottom: 28px;
  text-align: center;
}

.app-shell .brand {
  display: none;
}

.brand-mark {
  width: 66px;
  height: 66px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(145deg, #7ad1b9, #54ad95);
  color: white;
  font-size: 27px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(78, 169, 144, 0.20);
}

.brand h1 {
  margin: 0;
  color: #203d35;
  font-size: clamp(30px, 4.8vw, 46px);
  font-weight: 560;
  letter-spacing: 0.045em;
  line-height: 1.1;
}

.brand-sub {
  margin: 13px 0 0;
  color: #758e85;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel {
  width: 100%;
}

.panel-heading {
  margin-bottom: 24px;
  text-align: center;
}

.panel-heading h2 {
  margin: 0;
  color: #2a594c;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: 0.015em;
}

.panel-heading p {
  margin: 9px auto 0;
  max-width: 500px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.compact-heading {
  margin-bottom: 21px;
}

.step-label {
  width: fit-content;
  margin: 0 auto 18px;
  padding: 7px 12px;
  border: 1px solid #cae5dc;
  border-radius: 999px;
  background: rgba(239, 249, 246, 0.82);
  color: var(--mint-dark);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.09em;
}

form {
  width: 100%;
}

.field {
  display: block;
  margin-top: 15px;
}

.field > span {
  display: block;
  margin: 0 0 7px 4px;
  color: #687f77;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 58px;
  padding: 0 17px;
  border: 1px solid #d5e8e1;
  border-radius: 16px;
  outline: none;
  background: rgba(253, 255, 254, 0.98);
  color: #203f36;
  caret-color: #183930;
  cursor: text;
  font-size: 16px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.field input::placeholder {
  color: #a4b5af;
}

.field input:hover {
  border-color: #beded4;
}

.field input:focus {
  border-color: #69c7aa;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(105, 199, 170, 0.12);
}

.code-input {
  letter-spacing: 0.28em;
  font-variant-numeric: tabular-nums;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-links {
  margin-top: 12px;
}

.link-button,
.text-button {
  border: 0;
  background: transparent;
  color: var(--mint-dark);
  cursor: pointer;
}

.link-button {
  padding: 4px 1px;
  font-size: 12px;
}

.link-button:hover,
.text-button:hover {
  text-decoration: underline;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 730;
  letter-spacing: 0.055em;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.primary-button {
  margin-top: 24px;
  border: 0;
  background: linear-gradient(135deg, #76ceb5, #4faf92);
  color: white;
  box-shadow: 0 12px 28px rgba(79, 175, 146, 0.18);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(79, 175, 146, 0.24);
}

.secondary-button {
  margin-top: 11px;
  border: 1px solid #cfe4dd;
  background: rgba(255, 255, 255, 0.86);
  color: var(--mint-dark);
}

.secondary-button:hover:not(:disabled) {
  border-color: #acd6c8;
  background: #f3faf7;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: default;
  opacity: 0.56;
  transform: none;
  box-shadow: none;
}

.text-button {
  display: block;
  margin: 14px auto 0;
  padding: 6px 10px;
  font-size: 12px;
}

.cooldown-hint {
  min-height: 17px;
  margin: 8px 0 0;
  text-align: center;
  color: #81958e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ==================== DASHBOARD ==================== */

.dashboard-panel {
  min-height: 650px;
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}

.topbar-button,
.compact-button {
  border: 1px solid #d6e7e2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #3e7061;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.025em;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.topbar-button {
  padding: 10px 14px;
}

.topbar-button:hover,
.compact-button:hover {
  border-color: #acd5c8;
  background: #f3faf7;
  transform: translateY(-1px);
}

.topbar-button-muted {
  color: #7a9089;
}

.welcome-block {
  margin: 58px auto 44px;
  text-align: center;
  max-width: 720px;
}

.greeting-face {
  min-height: 58px;
  color: #4d9f8a;
  font-size: 46px;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}

.welcome-block h2 {
  margin: 22px 0 0;
  color: #203f37;
  font-size: clamp(30px, 4.8vw, 48px);
  font-weight: 570;
  letter-spacing: -0.025em;
}

.welcome-divider {
  width: 34px;
  height: 2px;
  margin: 25px auto 22px;
  border-radius: 99px;
  background: linear-gradient(90deg, #78cdb5, #8ec8df);
}

.daily-greeting {
  margin: 0;
  color: #738b83;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}

.dashboard-grid-main {
  width: min(760px, 100%);
  margin: 0 auto 26px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-tile {
  min-height: 126px;
  padding: 22px 22px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 16px;
  border-radius: 22px;
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.tile-blue {
  border: 1px solid #d4e7f0;
  background:
    linear-gradient(145deg, rgba(247, 252, 254, 0.98), rgba(237, 247, 251, 0.95));
  box-shadow: 0 14px 34px rgba(75, 137, 165, 0.08);
}

.tile-green {
  border: 1px solid #d3e9e1;
  background:
    linear-gradient(145deg, rgba(249, 253, 251, 0.98), rgba(238, 249, 245, 0.95));
  box-shadow: 0 14px 34px rgba(67, 139, 112, 0.08);
}

.dashboard-tile:hover {
  transform: translateY(-3px);
}

.tile-blue:hover {
  border-color: #b9d9e8;
  box-shadow: 0 18px 42px rgba(75, 137, 165, 0.12);
}

.tile-green:hover {
  border-color: #b7ddcf;
  box-shadow: 0 18px 42px rgba(67, 139, 112, 0.12);
}

.tile-icon,
.placeholder-icon {
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 800;
}

.tile-icon {
  width: 48px;
  height: 48px;
}

.tile-blue .tile-icon {
  background: #e5f3f9;
  color: var(--blue-deep);
}

.tile-green .tile-icon {
  background: #e5f5ef;
  color: var(--mint-dark);
}

.tile-copy strong {
  color: #26473e;
  font-size: 18px;
  font-weight: 700;
}

.tile-arrow {
  color: #8aa099;
  font-size: 20px;
}

/* ==================== APP PANELS ==================== */

.app-panel {
  min-height: 620px;
}

.section-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e4efeb;
}

.section-topline h2 {
  margin: 0;
  color: #24463d;
  font-size: 25px;
  font-weight: 650;
}

.compact-button {
  padding: 9px 13px;
}

.feature-placeholder {
  width: min(520px, 100%);
  margin: 105px auto 0;
  text-align: center;
}

.placeholder-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  background: linear-gradient(145deg, #eaf7f3, #edf7fb);
  color: #478f7d;
}

.feature-placeholder h3 {
  margin: 0;
  color: #31584c;
  font-size: 20px;
}

.feature-placeholder p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.settings-summary {
  margin: 34px 0 22px;
  border: 1px solid #dcebe6;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.summary-row {
  min-height: 58px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.summary-row + .summary-row {
  border-top: 1px solid #e6f0ed;
}

.summary-row span {
  color: #84968f;
  font-size: 12px;
}

.summary-row strong {
  color: #345d51;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.settings-actions {
  display: grid;
  gap: 10px;
}

.settings-action {
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #d8e9e3;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: #315d50;
  cursor: pointer;
  text-align: left;
}

.settings-action:hover {
  border-color: #b8dacf;
  background: #f6fbf9;
}

#status {
  min-height: 19px;
  margin: 16px 0 0;
  text-align: center;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

#status.success {
  color: var(--success);
}

#status.error {
  color: var(--danger);
}

.footer-note {
  margin: 26px 0 0;
  text-align: center;
  color: #9aaea7;
  font-size: 10px;
}

.app-shell .footer-note {
  margin-top: 8px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 760px) {
  .page {
    padding: 10px;
    align-items: flex-start;
  }

  .auth-shell,
  .auth-shell.app-shell {
    width: 100%;
    min-height: calc(100vh - 20px);
    padding: 34px 22px 26px;
    border-radius: 24px;
  }

  .auth-shell.app-shell {
    padding: 18px 18px 24px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 19px;
    border-radius: 18px;
  }

  .brand h1 {
    font-size: 31px;
  }

  .welcome-block {
    margin: 42px auto 34px;
  }

  .greeting-face {
    font-size: 40px;
  }

  .welcome-block h2 {
    font-size: 32px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-tile {
    min-height: 106px;
  }

  .summary-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.boot-panel{min-height:250px;display:grid;place-items:center;align-content:center;gap:16px;color:#789087}.boot-panel p{margin:0;font-size:13px}.boot-spinner{width:34px;height:34px;border-radius:50%;border:3px solid #dcece7;border-top-color:#58b597;animation:bootspin .8s linear infinite}@keyframes bootspin{to{transform:rotate(360deg)}}.tile-icon svg{width:25px;height:25px;display:block}.dashboard-tile .tile-icon{font-size:0}


/* v8: use the official deep-green FDIS PNG on the sign-in screen. */
.brand-mark{width:88px;height:88px;margin:0 auto 20px;padding:0;border-radius:0;background:transparent;box-shadow:none;display:grid;place-items:center;color:transparent;font-size:0}
.brand-mark img{display:block;width:100%;height:100%;object-fit:contain}
.topbar-button.icon-only,.compact-button.icon-only{width:48px;height:48px;padding:0;display:grid;place-items:center;border-radius:15px}
.topbar-button.icon-only svg,.compact-button.icon-only svg{width:21px;height:21px;display:block;fill:currentColor}
.dashboard-topbar{min-height:52px}
.settings-home-icon{margin-left:auto}
@media(max-width:560px){.brand-mark{width:76px;height:76px}.topbar-button.icon-only,.compact-button.icon-only{width:44px;height:44px}}

/* v8: subtle visual polish for Settings without changing its content. */
#settingsPanel{background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(249,253,251,.96))}
#settingsPanel .section-topline{align-items:center;padding-bottom:22px;border-bottom-color:#dcece6}
#settingsPanel .section-topline h2{font-size:28px;letter-spacing:-.025em}
#settingsPanel .settings-summary{box-shadow:0 12px 30px rgba(42,105,86,.045);background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(247,252,250,.88))}
#settingsPanel .summary-row{min-height:66px;padding:16px 22px}
#settingsPanel .summary-row span{font-size:13px}
#settingsPanel .summary-row strong{font-size:14px}
#settingsPanel .settings-actions{gap:12px}
#settingsPanel .settings-action{min-height:66px;padding:16px 22px;background:linear-gradient(140deg,rgba(255,255,255,.96),rgba(248,253,251,.91));box-shadow:0 8px 20px rgba(42,105,86,.035);font-size:15px}
#settingsPanel .settings-action:hover{border-color:#b9ded0;box-shadow:0 12px 24px rgba(42,105,86,.07);transform:translateY(-1px)}
#settingsPanel #settingsLogoutBtn{margin-top:14px;min-height:66px;border-radius:17px;font-size:15px}

/* Airy blue/mint dashboard icon set. */
.greeting-face{min-height:64px}
.greeting-face img{display:block;width:64px;height:64px;margin:0 auto;object-fit:contain}
