:root {
  color-scheme: light;
  --ios-bg: #f8fafc;
  --ios-card: #ffffff;
  --ios-label: #0f172a;
  --ios-secondary: #64748b;
  --ios-tertiary: #94a3b8;
  --ios-line: rgba(226, 232, 240, 0.85);
  --ios-blue: #2caee0;
  --ios-blue-dark: #1b9bd0;
  --ios-green: #10b981;
  --ios-red: #ef4444;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Kantumruy Pro", Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(44, 174, 224, 0.08), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(16, 185, 129, 0.06), transparent 30%),
    var(--ios-bg);
  color: var(--ios-label);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.login-wrap,
.dashboard-shell {
  width: min(100%, 430px);
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 42%),
    radial-gradient(circle at 18% 0%, rgba(44, 174, 224, 0.1), transparent 34%),
    radial-gradient(circle at 94% 18%, rgba(16, 185, 129, 0.08), transparent 30%),
    var(--ios-bg);
}

.login-card,
.dashboard-card {
  width: 100%;
  padding: 22px 18px;
  max-height: calc(100dvh - 24px);
  border-radius: 12px;
  background: var(--ios-card);
  border: 1px solid var(--ios-line);
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.logo-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-blue-dark));
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(44, 174, 224, 0.35);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--ios-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

h1 {
  margin: 0;
  text-align: center;
  color: var(--ios-label);
  font-size: 1.72rem;
  line-height: 1.06;
  font-weight: 800;
}

.lede {
  margin: 6px 0 0;
  text-align: center;
  color: var(--ios-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.login-form label {
  display: grid;
  gap: 5px;
  color: var(--ios-label);
  font-size: 13px;
  font-weight: 700;
}

.input-field {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ios-label);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}

.input-field::placeholder {
  color: var(--ios-tertiary);
}

.input-field:focus {
  background: #ffffff;
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(44, 174, 224, 0.18);
}

.password-row {
  position: relative;
}

.password-row .input-field {
  padding-right: 74px;
}

.icon-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 60px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--ios-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s;
}

.icon-button:hover {
  background: #e2e8f0;
}

.remember-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--ios-secondary);
  font-size: 13px;
  font-weight: 650;
}

.remember-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ios-blue);
}

.btn-login {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-blue-dark));
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(44, 174, 224, 0.35);
  transition: transform 0.16s, filter 0.16s, box-shadow 0.16s;
}

.btn-login:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px rgba(44, 174, 224, 0.42);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: scale(0.99);
}

.login-footer {
  margin-top: 12px;
  text-align: center;
  color: var(--ios-secondary);
  font-size: 13px;
}

.login-footer p {
  margin: 0;
}

.login-footer a {
  color: var(--ios-blue);
  font-weight: 800;
  text-decoration: underline;
}

.alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.2);
  color: #b42318;
  font-size: 13px;
  line-height: 1.35;
}

.alert ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 380px) {
  .login-wrap,
  .dashboard-shell {
    padding: 10px;
  }

  .login-card,
  .dashboard-card {
    padding: 16px 14px;
  }

  h1 {
    font-size: 1.58rem;
  }

  .login-form {
    gap: 8px;
    margin-top: 12px;
  }

  .login-form label {
    font-size: 12px;
  }

  .input-field {
    min-height: 44px;
  }
}

@media (max-height: 700px) {
  .logo-mark {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    font-size: 15px;
  }

  h1 {
    font-size: 1.48rem;
  }

  .lede {
    margin-top: 4px;
    font-size: 12px;
  }

  .login-form {
    gap: 8px;
    margin-top: 10px;
  }

  .login-footer {
    margin-top: 10px;
  }

  .alert {
    margin-top: 10px;
  }
}
