:root {
  --green-700: #157347;
  --green-600: #198754;
  --green-100: #eaf7ef;

  --gray-950: #17212b;
  --gray-800: #26323f;
  --gray-700: #3f4b57;
  --gray-600: #5d6975;
  --gray-500: #7b8792;
  --gray-300: #d7dde2;
  --gray-200: #e9edf0;
  --gray-100: #f4f6f8;
  --gray-50: #f8f9fa;

  --white: #ffffff;

  --shadow-card:
    0 8px 24px rgba(23, 33, 43, 0.08);

  --content-width: 480px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--gray-50);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(
      180deg,
      rgba(21, 115, 71, 0.045) 0,
      transparent 260px
    ),
    var(--gray-50);
  color: var(--gray-950);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

.login-page {
  display: grid;
  min-height: 100vh;
  padding:
    calc(28px + env(safe-area-inset-top))
    16px
    calc(28px + env(safe-area-inset-bottom));
  place-items: center;
}

.login-shell {
  width: 100%;
  max-width: var(--content-width);
}

.institution-header {
  margin-bottom: 24px;
  padding: 0 2px;
}

.institution-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.institution-shield {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  object-fit: contain;
}

.brand-content {
  min-width: 0;
  flex: 1;
}

.system-name {
  margin: 0;
  color: var(--green-700);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.system-description {
  margin: 7px 0 0;
  color: var(--gray-800);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
}

.institution-name {
  margin: 5px 0 0;
  color: var(--green-700);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.login-card {
  padding: 26px 24px 24px;
  border: 1px solid rgba(215, 221, 226, 0.76);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.access-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 15px;
  background: var(--green-100);
  color: var(--green-700);
}

.access-icon svg {
  width: 23px;
  height: 23px;
}

.login-heading {
  margin-bottom: 24px;
}

.card-kicker {
  margin: 0 0 5px;
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-transform: uppercase;
}

.card-title {
  margin: 0;
  color: var(--gray-950);
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.card-description {
  margin: 10px 0 0;
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.55;
}

.google-button {
  display: flex;
  min-height: 56px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 14px 18px;
  border: 1px solid var(--gray-300);
  border-radius: 16px;
  background: var(--white);
  box-shadow:
    0 2px 8px rgba(23, 33, 43, 0.05);
  color: var(--gray-800);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 80ms ease;
}

.google-button:hover {
  border-color: #c4ccd3;
  background: var(--gray-50);
  box-shadow:
    0 5px 14px rgba(23, 33, 43, 0.08);
}

.google-button:active {
  transform: scale(0.985);
}

.google-button:focus-visible {
  outline: 3px solid rgba(21, 115, 71, 0.22);
  outline-offset: 3px;
}

.google-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
}

.security-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
}

.security-note p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--gray-500);
  font-size: 0.7rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green-600);
  box-shadow:
    0 0 0 4px rgba(25, 135, 84, 0.1);
}

@media (max-width: 380px) {
  .login-page {
    padding-right: 14px;
    padding-left: 14px;
  }

  .institution-shield {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .system-name {
    font-size: 1.8rem;
  }

  .system-description {
    font-size: 0.72rem;
  }

  .institution-name {
    font-size: 0.82rem;
  }

  .login-card {
    padding: 22px 19px;
  }
}

@media (min-width: 720px) {
  .institution-shield {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
  }

  .system-name {
    font-size: 2.25rem;
  }

  .system-description {
    font-size: 0.86rem;
  }

  .institution-name {
    font-size: 0.96rem;
  }

  .login-card {
    padding: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .google-button {
    transition: none;
  }
}

body.session-checking .login-page {
  visibility: hidden;
}