:root {
  --bg-primary: #f4f8fc;
  --bg-secondary: #dbe8f9;
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: rgba(148, 163, 184, 0.18);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary: #007BFF;
  --primary-hover: #0056d6;
  --field-border: #d6dfeb;
  --field-border-focus: rgba(23, 105, 255, 0.38);
  --error: #dc2626;
  --success: #0f9f6e;
  --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.14);
  --radius-xl: 28px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --field-padding-x: 1rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(23, 105, 255, 0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(14, 87, 221, 0.16), transparent 30%),
    linear-gradient(135deg, var(--bg-primary), #eff4fb 58%, var(--bg-secondary));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(6px);
}

body::before {
  width: 16rem;
  height: 16rem;
  top: 9%;
  right: 8%;
  background: rgba(23, 105, 255, 0.08);
}

body::after {
  width: 12rem;
  height: 12rem;
  bottom: 8%;
  left: 10%;
  background: rgba(15, 23, 42, 0.06);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem 0.9rem;
}

.login-card {
  width: min(100%, 31rem);
  padding: 1.65rem 1.45rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 1.15rem;
  background: linear-gradient(145deg, #0f172a, #1769ff);
  box-shadow: 0 14px 22px rgba(23, 105, 255, 0.22);
  overflow: hidden;
}

.company-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 40%;
}

.brand-fallback {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.8vw, 2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.login-description {
  margin: 0.82rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.login-form {
  margin-top: 1.25rem;
}

.form-field {
  margin-bottom: 0.78rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.4rem;
  padding-left: var(--field-padding-x);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-field input {
  width: 100%;
  height: 2.82rem;
  padding: 0 var(--field-padding-x);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-md);
  outline: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.form-field input::placeholder {
  color: #94a3b8;
}

.form-field input:focus {
  border-color: rgba(23, 105, 255, 0.72);
  box-shadow: 0 0 0 4px var(--field-border-focus);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.9rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.password-toggle:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-primary);
}

.password-toggle svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.form-message {
  min-height: 1.2rem;
  margin: 0.25rem 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.form-message.is-error {
  color: var(--error);
}

.form-message.is-success {
  color: var(--success);
}

.submit-button {
  width: 100%;
  height: 3.15rem;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #0d5bf3);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(23, 105, 255, 0.2);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 30px rgba(23, 105, 255, 0.28);
  background: linear-gradient(135deg, var(--primary-hover), #0c4fce);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.84;
  transform: none;
  box-shadow: 0 12px 20px rgba(23, 105, 255, 0.18);
}

.is-hidden {
  display: none;
}

@media (max-width: 520px) {
  .login-card {
    width: min(100%, 28rem);
    padding: 1.45rem 1.15rem;
    border-radius: 1.35rem;
  }

  .brand-block {
    gap: 0.75rem;
  }

  .brand-mark {
    width: 2.95rem;
    height: 2.95rem;
    border-radius: 0.95rem;
  }

  .brand-copy h1 {
    font-size: 1.8rem;
  }

  .login-description {
    font-size: 0.92rem;
  }
}
