:root {
  --sg-blue: #0a66c2;
  --sg-blue-dark: #073d7a;
  --sg-orange: #ff8a00;
  --sg-bg: #f8fbff;
  --sg-slate: #374151;
  --sg-muted: #64748b;
  --shadow: 0 24px 80px rgba(9, 34, 86, 0.12);
  --radius: 28px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.user-login-page {
  margin: 0;
  background: linear-gradient(180deg, #0b4da3 0%, #0a66c2 38%, #f8fbff 100%);
  color: #0f172a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.user-login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.14), transparent 24%), radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 16%);
  pointer-events: none;
}

.login-screen {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 24px 16px 28px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #0d5fac 0%, #0a66c2 58%, #0c5aac 100%);
  border-radius: 34px;
  padding: 28px 22px 24px;
  box-shadow: 0 20px 64px rgba(9, 34, 86, 0.16);
}

/* entrance animations */
.hero-panel.ready { animation: heroRise 700ms cubic-bezier(.2,.9,.2,1) both; }
@keyframes heroRise { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none } }

.hero-graphic { transition: transform 4s ease-in-out; }
.hero-graphic.float { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0% { transform: translateY(0px); } 50% { transform: translateY(-6px); } 100% { transform: translateY(0px); } }

.hero-panel::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -58px;
  height: 120px;
  background: radial-gradient(circle at center top, rgba(255, 136, 0, 0.18), transparent 45%);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-brand-icon {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
}

.hero-brand-icon svg {
  width: 26px;
  height: 26px;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}

.brand-name .brand-accent {
  color: var(--sg-orange);
}

.hero-divider {
  margin: 18px 0 22px;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--sg-orange);
}

.hero-title {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #fff;
}

.hero-copy {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 320px;
}

.hero-graphic {
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 180px;
  opacity: 0.95;
}

.login-card {
  margin-top: -28px;
  position: relative;
  background: #fff;
  border-radius: 34px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -32px;
  right: -38px;
  width: 120px;
  height: 120px;
  background: rgba(255, 138, 0, 0.07);
  border-radius: 50%;
}

.login-card::after {
  content: '';
  position: absolute;
  bottom: -28px;
  left: -18px;
  width: 176px;
  height: 176px;
  background: rgba(10, 102, 194, 0.08);
  border-radius: 50%;
}

.card-top {
  display: flex;
  justify-content: center;
  margin-top: -10px;
  margin-bottom: 18px;
}

.card-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(180deg, #f5f5f5 0%, #ffffff 100%);
  border-radius: 24px;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.card-logo svg {
  width: 36px;
  height: 36px;
}

.card-title {
  text-align: center;
  margin-bottom: 6px;
}

.card-title h1 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.card-title p {
  margin: 14px auto 0;
  max-width: 280px;
  color: #475569;
  font-size: 0.98rem;
  line-height: 1.8;
}

.card-title .title-line {
  width: 48px;
  height: 4px;
  background: var(--sg-orange);
  border-radius: 999px;
  margin: 14px auto 0;
}

.form-group {
  margin-top: 18px;
}

.input-icon {
  position: relative;
}

.input-icon .icon-box {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  border-radius: 14px;
  color: var(--sg-blue);
}

.input-icon .icon-box svg {
  width: 20px;
  height: 20px;
}

.input-icon input {
  width: 100%;
  border: 1px solid #d9e7ff;
  border-radius: 18px;
  padding: 16px 18px 16px 62px;
  background: #f8fbff;
  color: #0f172a;
  font-size: 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-icon input::placeholder {
  color: #94a3b8;
}

.input-icon input:focus {
  border-color: var(--sg-blue);
  outline: none;
  box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.12);
}

.password-wrap {
  position: relative;
}

.eye-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: #eff6ff;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.eye-toggle:hover {
  transform: translateY(-50%) scale(1.03);
  background: rgba(16, 46, 122, 0.1);
}

.eye-toggle svg {
  width: 18px;
  height: 18px;
}

.field-hint {
  margin-top: 8px;
  min-height: 18px;
  color: #dc2626;
  font-size: 0.88rem;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.controls-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 0.94rem;
}

.controls-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--sg-blue);
}

.controls-row .forgot-link {
  color: var(--sg-blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.94rem;
}

.controls-row .forgot-link:hover {
  text-decoration: underline;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, var(--sg-orange), #ff7f00);
  color: #fff;
  box-shadow: 0 18px 34px rgba(255, 138, 0, 0.24);
}

/* arrow and loader inside button */
.btn-arrow-wrap{width:36px;height:36px;border-radius:10px;background:rgba(255,255,255,0.12);display:inline-grid;place-items:center;margin-left:8px;transition:transform 220ms ease}
.btn-arrow{font-size:18px;line-height:1;color:#fff}
.btn-primary:hover .btn-arrow-wrap{transform:translateX(6px)}
.btn-loader{width:18px;height:18px;border-radius:50%;border:2px solid rgba(255,255,255,0.28);border-top-color:#fff;display:inline-block;opacity:0;transform:scale(.85);transition:opacity 220ms ease,transform 220ms ease}
.btn-primary.loading .btn-loader{opacity:1;transform:scale(1);animation:spin 900ms linear infinite}
.btn-primary.loading .btn-text{opacity:0.01}

@keyframes spin{to{transform:rotate(360deg)}}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-primary.loading {
  opacity: 0.9;
}

.btn-outline,
.btn-secondary {
  width: 100%;
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-outline {
  border: 1px solid #bfd7ff;
  background: #fff;
  color: var(--sg-blue);
}

.btn-secondary {
  background: #eff6ff;
  color: var(--sg-blue);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0 14px;
  color: #94a3b8;
  font-size: 0.88rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--sg-blue);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.back-link svg {
  width: 18px;
  height: 18px;
}

/* make sure elements enter nicely */
.login-card.ready { animation: cardRise 640ms cubic-bezier(.22,.9,.28,1) both; }
@keyframes cardRise { from { opacity:0; transform: translateY(12px) scale(.998); } to { opacity:1; transform:none } }

.server-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff1f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-success {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 0.95rem;
}

@media (min-width: 460px) {
  .login-screen {
    padding: 34px 18px 28px;
  }
}

@media (max-width: 360px) {
  .login-screen {
    padding: 20px 12px 20px;
  }

  .hero-panel {
    padding: 22px 18px 20px;
  }

  .login-card {
    padding: 22px 16px 20px;
  }
}

/* Android / small-phone fit improvements */
@media (max-width: 420px) {
  .login-screen { width:100%; padding:18px 12px 18px; }
  .hero-panel { padding:18px 14px 16px; border-radius:20px; }
  .hero-brand { gap:10px }
  .hero-brand-icon { width:44px; height:44px }
  .brand-name { font-size:0.88rem }
  .hero-divider { width:36px; height:3px }
  .hero-title { font-size:2.2rem }
  .hero-copy { font-size:0.92rem; max-width:260px }
  .hero-graphic { width:140px; bottom:-8px; right:-8px; }

  .login-card { margin-top:-20px; padding:18px 14px 16px; border-radius:18px }
  .card-logo { width:64px; height:64px }
  .card-logo svg { width:32px; height:32px }
  .card-title h1 { font-size:1.3rem }
  .card-title p { font-size:0.92rem; max-width:240px }

  .input-icon .icon-box { width:40px; height:40px; border-radius:12px }
  .input-icon input { padding:14px 14px 14px 54px; font-size:0.98rem }
  .eye-toggle { width:40px; height:40px; right:8px }

  .controls-row { margin-top:12px }
  .btn { padding:14px 12px }
  .btn-primary { padding:14px 12px; font-size:1rem }

  .divider { margin:16px 0 }
}

/* Prevent very large elements causing overflow on some Android browsers */
html,body{max-width:100%;overflow-x:hidden}
