:root {
  color-scheme: dark;
  --bg: #0c1014;
  --card: rgba(20, 26, 32, 0.92);
  --field: #0f1419;
  --text: #eef2f4;
  --muted: #929da7;
  --line: #2a343d;
  --line-focus: #8496a5;
  --accent: #dfe7ec;
  --danger-bg: rgba(255, 120, 104, 0.09);
  --danger-line: rgba(255, 120, 104, 0.28);
  --danger-text: #ff9b8f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 15%, rgba(82, 105, 122, 0.13), transparent 32rem),
    radial-gradient(circle at 85% 88%, rgba(60, 91, 77, 0.1), transparent 28rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(24px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  place-items: center;
}

.login-card {
  width: min(100%, 430px);
  padding: clamp(30px, 6vw, 46px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 32px;
  padding: 12px;
  background: #e9eef1;
  border-radius: 15px;
  gap: 4px;
}

.brand-mark span {
  display: block;
  height: 4px;
  background: #141a20;
  border-radius: 999px;
}

.brand-mark span:nth-child(2) {
  width: 72%;
}

.brand-mark span:nth-child(3) {
  width: 42%;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 8vw, 38px);
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.intro {
  margin: 12px 0 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.error-message {
  margin: -8px 0 22px;
  padding: 12px 14px;
  color: var(--danger-text);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.45;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 6px;
  color: #c7d0d6;
  font-size: 14px;
  font-weight: 540;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: var(--text);
  caret-color: var(--accent);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover {
  border-color: #3a4650;
}

input:focus {
  background: #11171c;
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px rgba(132, 150, 165, 0.13);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--field) inset;
  transition: background-color 9999s ease-out;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 94px;
}

.reveal-password {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 36px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transform: translateY(-50%);
}

.reveal-password:hover,
.reveal-password:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.submit-button {
  min-height: 52px;
  margin-top: 14px;
  color: #11161a;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-weight: 680;
  transition: background 140ms ease, transform 140ms ease;
}

.submit-button:hover {
  background: #f7fafb;
}

.submit-button:active {
  transform: translateY(1px);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(223, 231, 236, 0.24);
  outline-offset: 3px;
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 12px;
}

.security-dot {
  width: 7px;
  height: 7px;
  background: #78ba93;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(120, 186, 147, 0.1);
}

@media (max-width: 520px) {
  .login-card {
    padding: 28px 24px;
    border-radius: 20px;
  }

  .brand-mark {
    margin-bottom: 26px;
  }
}

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