@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --brand-950: #2a0b12;
  --brand-900: #42101c;
  --brand-700: #781f32;
  --brand-600: #9a2b42;
  --ink-950: #17191e;
  --ink-600: #68707c;
  --line: #e3e6eb;
}

* {
  box-sizing: border-box;
}

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

body {
  align-items: center;
  background:
    radial-gradient(
      circle at 12% 15%,
      rgba(154, 43, 66, 0.13),
      transparent 30%
    ),
    radial-gradient(
      circle at 88% 82%,
      rgba(120, 31, 50, 0.10),
      transparent 28%
    ),
    #f5f6f8;
  color: var(--ink-950);
  display: flex;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  justify-content: center;
  margin: 0;
  min-height: 100dvh;
  padding: 28px;
}

/* Entire login container */
.login-shell {
  background: #fff;
  border: 1px solid rgba(227, 230, 235, 0.9);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(42, 11, 18, 0.15);
  display: grid;
  grid-template-columns:
    minmax(320px, 0.95fr)
    minmax(380px, 1.05fr);
  max-width: 980px;
  min-height: 590px;
  overflow: hidden;
  position: relative;
  top: 30px;
  width: 100%;
}

/* Left branding section */
.login-brand {
  align-items: center;
  background:
    linear-gradient(
      150deg,
      rgba(255, 255, 255, 0.04),
      transparent 55%
    ),
    linear-gradient(
      145deg,
      var(--brand-950),
      var(--brand-700)
    );
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 42px;
  position: relative;
}

.login-brand::after {
  border: 70px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
  content: "";
  height: 270px;
  pointer-events: none;
  position: absolute;
  right: -160px;
  top: 110px;
  width: 270px;
}

.brand-hero-logo {
  display: block;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.24));
  height: auto;
  max-height: 78%;
  max-width: 100%;
  object-fit: contain;
  position: relative;
  width: min(90%, 380px);
  z-index: 1;
}

/* Right login section */
.login-panel {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 54px clamp(32px, 6vw, 74px);
}

.login-card {
  max-width: 410px;
  width: 100%;
}

.login-card h2 {
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin: 0 0 34px;
}

.field-label {
  color: #3d424b;
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 8px;
}

/* Complete input container */
.field {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  margin-bottom: 20px;
  min-height: 50px;
  overflow: hidden;
  padding: 0 14px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Only the outer container receives the focus style */
.field:focus-within {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(154, 43, 66, 0.10);
}

.field-icon {
  align-items: center;
  color: #9aa0aa;
  display: inline-flex;
  flex: 0 0 20px;
  justify-content: center;
  margin-right: 10px;
}

.field-icon svg,
.eye-btn svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 20px;
}

/* Remove the ugly inner input outline */
.field input {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink-950);
  flex: 1;
  font-family: inherit;
  font-size: 0.93rem;
  min-height: 48px;
  min-width: 0;
  outline: none;
  padding: 0;
  width: 100%;
}

.field input:focus,
.field input:focus-visible,
.field input:active {
  border: 0;
  box-shadow: none;
  outline: none;
}

.field input::placeholder {
  color: #a0a6af;
  opacity: 1;
}

/* Prevent browser autofill from changing the design */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--ink-950);
  caret-color: var(--ink-950);
  transition: background-color 9999s ease-out;
}

/* Password eye button */
.eye-btn {
  align-items: center;
  background: transparent;
  border: 0;
  color: #858c97;
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  margin-left: 6px;
  outline: none;
  padding: 8px;
}

.eye-btn:hover {
  color: var(--brand-700);
}

.eye-btn:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

.eye-btn .eye-visible {
  display: none;
}

.eye-btn.is-showing .eye-hidden {
  display: none;
}

.eye-btn.is-showing .eye-visible {
  display: block;
}

/* Login error */
.login-error {
  background: #fff0f1;
  border: 1px solid #f4c8cd;
  border-radius: 10px;
  color: #a52436;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: -4px 0 18px;
  padding: 10px 12px;
}

/* Sign-in button */
.submit-btn {
  background:
    linear-gradient(
      135deg,
      var(--brand-900),
      var(--brand-700)
    );
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(120, 31, 50, 0.20);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 50px;
  outline: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  width: 100%;
}

.submit-btn:hover {
  box-shadow: 0 14px 28px rgba(120, 31, 50, 0.26);
  transform: translateY(-1px);
}

.submit-btn:active {
  box-shadow: 0 8px 16px rgba(120, 31, 50, 0.20);
  transform: translateY(0);
}

.submit-btn:focus-visible {
  outline: 3px solid rgba(154, 43, 66, 0.30);
  outline-offset: 3px;
}

/* Tablet and mobile */
@media (max-width: 760px) {
  body {
    align-items: flex-start;
    padding: 14px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    top: 15px;
  }

  .login-brand {
    height: 260px;
    min-height: 260px;
    padding: 24px;
  }

  .brand-hero-logo {
    max-height: 86%;
    width: min(78%, 330px);
  }

  .login-panel {
    padding: 38px 26px 44px;
  }

  .login-card h2 {
    font-size: 1.7rem;
    margin-bottom: 28px;
  }
}

/* Small mobile devices */
@media (max-width: 380px) {
  body {
    padding: 0;
  }

  .login-shell {
    border: 0;
    border-radius: 0;
    min-height: 100dvh;
    top: 0;
  }

  .login-brand {
    height: 220px;
    min-height: 220px;
  }

  .login-panel {
    padding: 32px 20px;
  }
}