@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --charcoal: #1c1b29;
  --surface-1: #232232;
  --surface-2: #2b2a3c;
  --thistle: #4a3b6b;
  --lavender: #b8a9d9;
  --cyan: #2fd1c5;
  --warm-white: #f7f5fa;
  --text-secondary: rgba(247, 245, 250, .68);
  --text-tertiary: rgba(247, 245, 250, .45);
  --border: rgba(247, 245, 250, .11);
  --border-hover: rgba(247, 245, 250, .2);
  --status-negative: #d98a94;
  --font-display: "Poppins", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--charcoal); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--warm-white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.login-screen {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(24px, 4.3vw, 58px) clamp(24px, 6vw, 88px) 26px;
  overflow: hidden;
}

.backdrop {
  position: fixed;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(19, 18, 30, .72) 0%, rgba(24, 22, 37, .38) 53%, rgba(21, 20, 34, .57) 100%),
    linear-gradient(0deg, rgba(21, 20, 32, .67) 0%, transparent 42%, rgba(21, 20, 32, .25) 100%),
    url("/auth-assets/wallpaper.webp") center / cover no-repeat,
    var(--charcoal);
  transform: scale(1.015);
}

.backdrop::after {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(ellipse at 50% 51%, transparent 2%, rgba(22, 20, 35, .1) 42%, rgba(22, 20, 35, .55) 100%);
}

.brand-bar, .page-footer { position: relative; z-index: 1; }

.brand-bar {
  display: flex;
  align-items: center;
  gap: 17px;
  width: fit-content;
  animation: enter-soft .65s ease-out both;
}

.brand-logo {
  display: block;
  width: 132px;
  height: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: rgba(247, 245, 250, .32);
}

.brand-product {
  color: rgba(247, 245, 250, .88);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .015em;
}

.login-card {
  position: relative;
  justify-self: center;
  width: min(100%, 430px);
  margin: 38px 0;
  padding: 42px 42px 29px;
  overflow: hidden;
  border: 1px solid rgba(247, 245, 250, .19);
  border-radius: 17px;
  background:
    linear-gradient(148deg, rgba(43, 42, 60, .87), rgba(30, 29, 44, .92) 72%),
    var(--surface-1);
  box-shadow: 0 26px 90px rgba(11, 10, 20, .42), 0 2px 12px rgba(11, 10, 20, .16), inset 0 1px 0 rgba(247, 245, 250, .09);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: enter-card .72s cubic-bezier(.2, .75, .25, 1) .07s both;
}

.card-accent {
  position: absolute;
  top: 0;
  left: 42px;
  width: 54px;
  height: 2px;
  background: var(--cyan);
  opacity: .88;
}

.client-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 17px;
  color: var(--lavender);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .125em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(47, 209, 197, .12);
}

h1 {
  margin: 0;
  color: var(--warm-white);
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 29px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.28;
}

.intro {
  margin: 9px 0 27px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.error-message:empty { display: none; }
.error-message:not(:empty) {
  margin: -8px 0 21px;
  padding: 11px 13px;
  border: 1px solid rgba(217, 138, 148, .37);
  border-radius: 7px;
  background: rgba(217, 138, 148, .11);
  color: #f0bac0;
  font-size: 13px;
  line-height: 1.5;
}

.field { margin-top: 19px; }

.field label {
  display: block;
  margin: 0 0 8px 1px;
  color: rgba(247, 245, 250, .84);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .015em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  height: 49px;
  padding: 0 14px 0 43px;
  border: 1px solid rgba(247, 245, 250, .13);
  border-radius: 7px;
  outline: none;
  background: rgba(15, 14, 25, .31);
  color: var(--warm-white);
  font-size: 14px;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.input-wrap input:hover { border-color: var(--border-hover); }
.input-wrap input:focus {
  border-color: rgba(184, 169, 217, .8);
  background: rgba(15, 14, 25, .45);
  box-shadow: 0 0 0 3px rgba(184, 169, 217, .12);
}

.field-icon {
  position: absolute;
  z-index: 1;
  left: 14px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: rgba(184, 169, 217, .77);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
  pointer-events: none;
}

.password-wrap input { padding-right: 48px; }

.visibility-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.visibility-toggle:hover { color: var(--lavender); background: rgba(247, 245, 250, .06); }
.visibility-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.visibility-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}
.eye-closed { display: none; }
.visibility-toggle[aria-pressed="true"] .eye-open { display: none; }
.visibility-toggle[aria-pressed="true"] .eye-closed { display: block; }

.submit-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 49px;
  margin-top: 27px;
  border: 1px solid rgba(47, 209, 197, .55);
  border-radius: 7px;
  background: var(--cyan);
  color: #1c1b29;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .015em;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  background: #57ddd3;
  box-shadow: 0 7px 20px rgba(47, 209, 197, .18);
}
.submit-button:active { transform: translateY(0); }
.submit-button:focus-visible { outline: 3px solid rgba(247, 245, 250, .84); outline-offset: 3px; }
.button-arrow {
  position: absolute;
  right: 16px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition: transform .18s ease;
}
.submit-button:hover .button-arrow { transform: translateX(2px); }
.button-progress { display: none; }

.submit-button.is-submitting {
  cursor: wait;
  opacity: .86;
}
.submit-button.is-submitting .button-arrow { display: none; }
.submit-button.is-submitting .button-progress {
  position: absolute;
  right: 16px;
  display: block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(28, 27, 41, .25);
  border-top-color: #1c1b29;
  border-radius: 50%;
  animation: submit-turn .8s linear infinite;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: .01em;
}
.secure-note svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgba(247, 245, 250, .56);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .08em;
  animation: enter-soft .7s ease-out .18s both;
}
.footer-separator { padding: 0 6px; color: var(--cyan); }
.footer-caption { color: rgba(247, 245, 250, .4); }

@keyframes enter-card {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes enter-soft {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes submit-turn { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .login-screen {
    grid-template-rows: auto 1fr auto;
    padding: 27px 21px 20px;
  }
  .brand-bar { gap: 12px; }
  .brand-logo { width: 109px; }
  .brand-divider { height: 21px; }
  .brand-product { font-size: 12px; }
  .login-card {
    width: min(100%, 430px);
    margin: 34px auto;
    padding: 34px 25px 25px;
    border-radius: 14px;
  }
  .card-accent { left: 25px; }
  .intro { margin-bottom: 24px; }
  .page-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 360px) {
  .brand-logo { width: 96px; }
  .brand-bar { gap: 9px; }
  .brand-product { font-size: 11px; }
  .login-card { padding-right: 20px; padding-left: 20px; }
  .card-accent { left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
