:root {
  --midnight: #0A162D;
  --star-blue: #179EF9;
  --ice: #F1F8FF;
  --line: #D6E2F0;
  --ink: #0A162D;
  --muted: #5B6B82;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--star-blue); }

button,
input { font: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-page {
  background: var(--midnight);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  padding: 38px 38px 36px;
}

.login-vision-logo {
  display: block;
  width: min(184px, 100%);
  height: auto;
  margin: 0 auto 20px;
}

.purco-logo {
  display: block;
  width: 148px;
  height: auto;
  margin: 0 auto 34px;
}

.signin-form {
  display: grid;
  gap: 8px;
}

.signin-form label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 5px;
}

.signin-form input {
  min-height: 46px;
  width: 100%;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.signin-form input:focus {
  border-color: var(--star-blue);
  box-shadow: 0 0 0 3px rgba(23, 158, 249, 0.2);
}

.signin-form button,
.primary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--star-blue);
  color: var(--midnight);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.signin-form button { margin-top: 16px; }

.signin-form button:hover,
.primary-button:hover { filter: brightness(1.04); }

.login-error {
  color: #B42318;
  font-size: 0.86rem;
  line-height: 1.45;
  margin: 4px 0 0;
}

.portal-page {
  min-height: 100vh;
  background: var(--ice);
}

.portal-topbar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 5vw, 72px);
  background: var(--midnight);
}

.topbar-logo {
  display: block;
  width: auto;
  height: 34px;
}

.signout-link,
.back-link {
  color: var(--star-blue);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

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

.chooser-main {
  width: min(100% - 40px, 1060px);
  margin: 0 auto;
  padding: clamp(48px, 9vh, 100px) 0 56px;
}

.chooser-main h1 {
  color: var(--midnight);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 34px;
  text-align: center;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.demo-card {
  min-height: 324px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 30px;
  box-shadow: 0 10px 28px rgba(10, 22, 45, 0.06);
}

.demo-logo {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
}

.chooser-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.demo-card h2 {
  color: var(--midnight);
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0 0 12px;
}

.demo-card p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
  margin: 0 0 26px;
}

.primary-button {
  min-width: 132px;
  margin-top: auto;
  padding: 11px 18px;
}

.demo-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--midnight);
}

.demo-topbar {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.demo-topbar .topbar-logo { height: 26px; }

.demo-name {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.demo-frame {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  background: var(--white);
}

@media (max-width: 700px) {
  .login-card { padding: 32px 26px 28px; }
  .portal-topbar { padding: 0 20px; }
  .chooser-main { width: min(100% - 32px, 520px); padding-top: 48px; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-card { min-height: 290px; }
  .demo-logo,
  .chooser-logo { height: 40px; }
  .demo-topbar { gap: 12px; padding: 0 12px; }
  .demo-name { margin-left: auto; font-size: 0.76rem; }
}
