:root {
  --blue: #1e78d6;
  --blue-dark: #0b3d73;
  --blue-deep: #082848;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #3aa0ff 0%, transparent 45%),
              linear-gradient(165deg, #082848 0%, #0b4a8a 48%, #1e78d6 100%);
  color: var(--text);
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: rgba(255,255,255,0.96);
  border-radius: 28px;
  padding: 28px 22px 24px;
  box-shadow: 0 24px 60px rgba(5, 20, 46, 0.28);
  backdrop-filter: blur(12px);
}

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

.brand img {
  width: min(220px, 72%);
  height: auto;
  display: block;
  margin: 0 auto 6px;
  mix-blend-mode: multiply;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.alert {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.input-wrap input {
  width: 100%;
  height: 50px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 0 14px 0 44px;
  font-size: 15px;
  outline: none;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(30, 120, 214, 0.12);
}

.btn-login {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  margin-top: 8px;
  background: linear-gradient(135deg, #1e78d6, #0b4a8a);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(14, 78, 160, 0.28);
}

.btn-login:active { transform: translateY(1px); }

.foot {
  text-align: center;
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  margin-top: 16px;
  font-weight: 600;
}

.pwa-install {
  position: relative;
  margin-top: 16px;
  background: rgba(255,255,255,0.96);
  border-radius: 22px;
  padding: 14px 14px 12px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px 12px;
  align-items: center;
  box-shadow: 0 16px 40px rgba(5, 20, 46, 0.22);
}

.pwa-install.hidden,
.pwa-install[hidden] { display: none !important; }

.pwa-install img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.pwa-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-copy b { font-size: 13px; color: #0b4a8a; }
.pwa-copy span { font-size: 11px; color: #64748b; line-height: 1.35; }

.pwa-btn {
  border: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e78d6, #0b4a8a);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pwa-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pwa-ios {
  grid-column: 1 / -1;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .login-card { padding: 36px 32px 28px; }
}
