:root {
  --primary: #961E20;
  --primary-dark: #7A1719;
  --primary-light: #B94547;
  --primary-tint: #F7E9E9;
  --text: #2B2020;
  --text-muted: #8A7B7B;
  --border: #E5DCDC;
  --radius-lg: 36.4px;
  --radius-md: 18.2px;
}

* { box-sizing: border-box; }

@font-face {
  font-family: 'DINOT';
  src: url('assets/fonts/dinot-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DINOT';
  src: url('assets/fonts/dinot-medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DINOT';
  src: url('assets/fonts/dinot-bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DINOT';
  src: url('assets/fonts/dinot-black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'DINOT', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background-color: #FFFFFF;
  background-image:
    linear-gradient(rgba(150,30,32,0.05) 1.3px, transparent 1.3px),
    linear-gradient(90deg, rgba(150,30,32,0.05) 1.3px, transparent 1.3px);
  background-size: 54.6px 54.6px;
}

.login-page {
  height: 100vh;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 31.2px;
}

.login-card {
  width: 100%;
  max-width: 1482px;
  height: 100%;
  max-height: 884px;
  background: #fff;
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 39px 91px rgba(43, 32, 32, 0.14);
  overflow: hidden;
}

/* Left */
.login-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3.6vh, 41.6px) 52px;
  overflow-y: auto;
  min-height: 0;
}

.login-left-inner {
  width: 100%;
  max-width: 494px;
}

.login-logo {
  height: clamp(46px, 8.5vh, 83.2px);
  width: auto;
  margin: 0 0 clamp(8px, 2.2vh, 23.4px) 0;
  display: block;
}

.welcome {
  font-size: clamp(26px, 4.2vh, 39px);
  font-weight: 800;
  margin: 0 0 clamp(2px, 1vh, 10.4px) 0;
}
.subtitle {
  font-size: clamp(14.5px, 2vh, 18.2px);
  color: var(--text-muted);
  margin: 0 0 clamp(12px, 3.6vh, 39px) 0;
}

/* First-time login hint under the greeting */
.first-login-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: clamp(12px, 2.6vh, 26px) 0 0 0;
  padding: clamp(8px, 1.4vh, 14px) 18px;
  background: var(--primary-tint);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: clamp(14px, 1.9vh, 16.25px);
  line-height: 1.5;
}
.first-login-note svg { flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px; color: var(--primary); }
.first-login-note p { margin: 0; }
.first-login-note strong { color: var(--primary-dark); }

.field-label {
  display: block;
  font-size: clamp(15px, 1.9vh, 17.55px);
  font-weight: 600;
  margin-bottom: clamp(6px, 1.1vh, 10.4px);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(10px, 2.8vh, 26px);
  margin-bottom: clamp(6px, 1.1vh, 10.4px);
}
.field-row .field-label { margin-bottom: 0; }

.forgot {
  font-size: 16.25px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.forgot-note {
  margin: -2.6px 0 15.6px 0;
  padding: 13px 15.6px;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  color: var(--text);
  font-size: 16.25px;
  line-height: 1.5;
}
.forgot-note a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.field-input {
  width: 100%;
  padding: clamp(9px, 1.8vh, 16.9px) 20.8px;
  border-radius: var(--radius-md);
  border: 1.3px solid var(--border);
  font-family: inherit;
  font-size: clamp(15px, 2vh, 18.2px);
  outline: none;
  color: var(--text);
  background: #fff;
}
.field-input::placeholder { color: #B7ACAC; }
.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3.9px rgba(150,30,32,0.1);
}
.field-input.invalid {
  border-color: #C0392B;
  box-shadow: 0 0 0 3.9px rgba(192,57,43,0.1);
}

.field-error {
  margin: 10.4px 2.6px 0 2.6px;
  font-size: 16.25px;
  color: #C0392B;
  font-weight: 500;
}

.password-wrap {
  position: relative;
}
.toggle-pw {
  position: absolute;
  right: 18.2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 5.2px;
  display: flex;
}
.toggle-pw svg { width: 23.4px; height: 23.4px; }
.toggle-pw.showing { color: var(--primary); }

.login-btn {
  width: 100%;
  margin-top: clamp(14px, 3.4vh, 33.8px);
  padding: clamp(10px, 1.9vh, 18.2px);
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 19.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.login-btn:hover { background: var(--primary-dark); }
.login-btn:disabled { opacity: 0.7; cursor: default; }

.signup-line {
  text-align: center;
  margin-top: clamp(12px, 3.6vh, 41.6px);
  font-size: clamp(14px, 1.85vh, 16.9px);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Right: KPIS banner */
.login-right {
  position: relative;
  margin: 23.4px;
  border-radius: 28.6px;
  overflow: hidden;
  background: #fff;
  border: 1.3px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 5vh, 48px) 44px;
  min-height: 0;
}

.banner-blob {
  position: absolute;
  border-radius: 50%;
  background: var(--primary-tint);
}
.banner-blob.big { width: 62%; aspect-ratio: 1; top: -22%; left: -26%; }
.banner-blob.small { width: 17%; aspect-ratio: 1; top: 36%; left: -8%; background: #E8C9CE; }

.banner-stripes {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, transparent 0 38%, var(--primary) 38% 52%, transparent 52% 62%, var(--primary) 62% 70%, transparent 70%);
}

.banner-logo {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: clamp(84px, 15vh, 130px);
  height: clamp(84px, 15vh, 130px);
  border-radius: 50%;
  background: #fff;
  border: 7px solid #AAB2CC;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.banner-logo img { width: 78%; height: 78%; object-fit: contain; }

.banner-slogan {
  position: relative;
  z-index: 1;
  margin: auto 0 0 48px;
  padding: 28px 0 34px 34px;
  width: max-content;
  max-width: calc(100% - 60px);
  font-size: clamp(30px, min(3.6vw, 6vh), 56px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.5px;
  color: var(--primary);
}
.banner-slogan span { display: block; }
.banner-slogan b { font-weight: 700; }
.banner-slogan::before,
.banner-slogan::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border: 0 solid var(--primary);
}
.banner-slogan::before { top: 0; left: 0; border-width: 4px 0 0 4px; }
.banner-slogan::after { right: -34px; bottom: 0; border-width: 0 4px 4px 0; }

.banner-tagline {
  position: relative;
  z-index: 1;
  margin: 28px 0 auto;
  text-align: right;
  font-size: clamp(16px, min(1.7vw, 3vh), 24px);
  font-weight: 500;
  line-height: 1.3;
  color: var(--primary);
}
/* Responsive */
@media (max-width: 1274px) {
  .login-card { grid-template-columns: 1fr; min-height: unset; }
  .login-right { display: none; }
  .login-left { padding: clamp(14px, 3.6vh, 52px) 36.4px; }
}

/* No scroll bars on the login screen. The form scales with the window height
   so it fits; if a very short window can't fit it, it still scrolls with the
   wheel or touch, just without a bar. */
.login-page, .login-left { scrollbar-width: none; -ms-overflow-style: none; }
.login-page::-webkit-scrollbar, .login-left::-webkit-scrollbar { display: none; }

/* Phones: a little less page padding, so the whole form fits the screen */
@media (max-width: 600px) {
  .login-page { padding: 12px; }
  .login-left { padding-left: 24px; padding-right: 24px; }
}
