*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --grm-navy: #0d2044;
  --grm-blue: #1a3a6b;
  --grm-accent: #c0392b;
  --grm-gold: #f0a500;
  --text-primary: #0d1f38;
  --text-subtle: #5a6a85;
  --border: #d4dce8;
  --bg-page: #eef2f8;
  --white: #ffffff;
  --radius: 14px;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #ffffff 0%, #eef2f8 40%, #c4d3e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-shell {
  width: 100%;
  max-width: 460px;
}
.login-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(13,32,68,.16);
  padding: 2.5rem 2.5rem 2rem;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.75rem;
}
.login-brand img {
  height: 40px;
  width: auto;
}
.login-brand-text .portal-name {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--grm-accent);
}
.login-brand-text .org-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--grm-navy);
  line-height: 1.2;
}
.login-heading { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.login-sub { color: var(--text-subtle); font-size: .92rem; margin-top: .4rem; margin-bottom: 1.75rem; line-height: 1.5; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; font-size: .88rem; color: var(--text-primary); margin-bottom: .45rem; }
.form-group input, .form-group select {
  width: 100%;
  padding: .72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: .97rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #f8fafc;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--grm-blue); box-shadow: 0 0 0 3px rgba(26,58,107,.12); background-color: var(--white); }
.btn-login {
  width: 100%;
  padding: .82rem 1rem;
  background: rgba(13, 32, 68, 0.86);
  color: var(--white);
  font-size: .97rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 30px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25), inset 0 2px 6px rgba(255,255,255,0.20);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s;
  margin-top: .5rem;
}
.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.14) 0%, transparent 55%, rgba(255,255,255,0.04) 100%);
  pointer-events: none;
}
.btn-login:hover {
  background: rgba(26, 58, 107, 0.92);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.34), inset 0 2px 6px rgba(255,255,255,0.24);
}
.btn-login:active { transform: scale(.99); }
.btn-back {
  display: inline-block;
  width: 100%;
  text-align: center;
  margin-top: .7rem;
  border: 1px solid rgba(13,32,68,0.2);
  background: rgba(255,255,255,0.6);
  color: var(--grm-navy);
  border-radius: 30px;
  padding: .78rem 1rem;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  text-decoration: none;
  transition: background .15s ease;
}
.btn-back:hover { background: rgba(255,255,255,0.9); }
.btn-download {
  width: 100%;
  padding: .82rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  color: var(--grm-navy);
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(13, 32, 68, 0.2);
  border-radius: 30px;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .15s ease;
}
.btn-download:hover { background: rgba(255, 255, 255, 0.9); }
.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 8px;
  padding: .7rem 1rem;
  font-size: .88rem;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  padding: .7rem 1rem;
  font-size: .88rem;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}
.policy-hint {
  font-size: .78rem;
  color: var(--text-subtle);
  margin-top: 4px;
}
.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: .8rem;
  color: var(--text-subtle);
}
@media (max-width: 500px) {
  .login-card { padding: 1.75rem 1.25rem 1.5rem; }
}

/* Classes to replace inline styles */
.forgot-password-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--grm-blue);
  text-decoration: none;
  outline: none;
  float: right;
  margin-top: 0.2rem;
}
.forgot-password-link:hover {
  text-decoration: underline;
}
.download-hint {
  font-size: .78rem;
  color: var(--text-subtle);
  margin-top: 0.5rem;
  text-align: center;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(13, 32, 68, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-box {
  width: min(100%, 560px);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(13, 32, 68, 0.34);
  padding: 1.5rem;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .45rem;
}
.modal-sub {
  font-size: .92rem;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: .9rem;
}
.modal-offline-note {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: .86rem;
  line-height: 1.45;
  padding: .8rem .9rem;
  margin-bottom: 1rem;
}
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: .9rem;
}
.platform-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.platform-card[href]:hover {
  transform: translateY(-2px);
  border-color: var(--grm-blue);
  box-shadow: 0 12px 24px rgba(13, 32, 68, 0.14);
}
.platform-card--unavail {
  opacity: .55;
  cursor: not-allowed;
}
.platform-icon {
  font-size: 1.9rem;
  line-height: 1;
}
.platform-label {
  font-weight: 700;
  color: var(--grm-navy);
}
.platform-note {
  font-size: .78rem;
  color: var(--text-subtle);
  line-height: 1.35;
}
.modal-cancel {
  width: 100%;
  border: 1px solid rgba(13, 32, 68, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--grm-navy);
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: .78rem 1rem;
}
.modal-cancel:hover {
  background: #ffffff;
}
.btn-login-block {
  display: block;
  text-align: center;
  text-decoration: none;
}
.d-none {
  display: none !important;
}
@media (max-width: 560px) {
  .modal-overlay { padding: .9rem; }
  .modal-box { padding: 1.15rem; }
  .platform-grid { grid-template-columns: 1fr; }
}
