:root {
  --navy: #071d41;
  --navy-2: #0b2c57;
  --blue: #0877ee;
  --blue-dark: #0754b8;
  --cyan: #19bfe8;
  --orange: #ff650d;
  --text: #11294d;
  --muted: #667892;
  --border: #d8e2ef;
  --surface: #ffffff;
  --bg: #f5f9fe;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.login-page {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 52% 48%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(25,191,232,.12), transparent 30%),
    radial-gradient(circle at 90% 85%, rgba(8,119,238,.14), transparent 35%),
    #f7fbff;
}

/* LEFT / BRAND PANEL */
.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,248,255,.93)),
    radial-gradient(circle at 85% 20%, rgba(25,191,232,.24), transparent 28%);
}

.brand-panel::before {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  right: -200px;
  top: -180px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(8,119,238,.15), rgba(25,191,232,.02));
  pointer-events: none;
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 600px;
  height: 220px;
  left: -140px;
  bottom: -100px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(8,119,238,.13), rgba(25,191,232,.03));
  transform: rotate(-7deg);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  height: 100%;
  max-height: 100vh;
  padding: clamp(18px, 3vh, 32px) clamp(24px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.brand-logo {
  max-width: 380px;
  width: 75%;
  height: auto;
  max-height: 95px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 20px rgba(15,53,100,.08));
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  margin-bottom: 10px;
}

.hero-copy h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(30px, 2.8vw, 46px);
  line-height: 1.08;
  letter-spacing: -1.5px;
  font-weight: 800;
}

.hero-copy h1 span { color: var(--blue); }
.hero-copy h1 b { color: var(--orange); }

.hero-copy p {
  max-width: 580px;
  margin: 12px 0 0;
  color: #475569;
  font-size: 14.5px;
  line-height: 1.55;
}

.feature-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 620px;
}

.feature {
  min-height: 98px;
  padding: 14px 10px;
  border: 1.5px solid rgba(126,170,213,.32);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 8px 22px rgba(16,65,110,.06);
  transition: all 0.22s ease;
}

.feature:hover {
  transform: translateY(-3px);
  background: #ffffff;
  border-color: rgba(8,119,238,.45);
  box-shadow: 0 12px 28px rgba(8,119,238,.12);
}

.feature .icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  color: var(--blue);
  background: #eaf5ff;
  font-size: 19px;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.feature:hover .icon {
  transform: scale(1.08);
}

.feature strong {
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
}

.feature span {
  margin-top: 3px;
  color: #64748b;
  font-size: 10.5px;
}

.brand-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: #7990aa;
  font-size: 9.5px;
  letter-spacing: .16em;
  font-weight: 700;
}

.brand-footer i {
  width: 30px;
  height: 1px;
  background: #b8cadc;
}

/* RIGHT / FORM PANEL */
.form-panel {
  min-height: 100vh;
  overflow-y: auto;
  padding: clamp(16px, 2.5vh, 28px) clamp(20px, 3.5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 100% 0%, rgba(25,191,232,.12), transparent 38%),
    linear-gradient(150deg, #f8fbff 0%, #eef6fd 100%);
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(20px, 2.8vh, 32px) clamp(24px, 3.2vw, 42px) clamp(16px, 2vh, 24px);
  border: 1px solid rgba(155,184,211,.36);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 20px 60px rgba(16,56,96,.12);
}

.mobile-logo-wrap { display: none; }

.login-header .mini-label {
  color: var(--blue);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .18em;
  margin-bottom: 6px;
}

.login-header h2 {
  margin: 0;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.8px;
  color: var(--navy);
}

.login-header h2 span { color: var(--blue); }

.login-header p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.m365-btn,
.signin-btn {
  width: 100%;
  height: 46px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.m365-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  background: #fff;
  border-color: #cfdae7;
}

.m365-btn:hover {
  border-color: #9fb9d4;
  transform: translateY(-1px);
}

.ms-icon {
  display: grid;
  grid-template-columns: 7px 7px;
  grid-template-rows: 7px 7px;
  gap: 2px;
}
.ms-icon i:nth-child(1) { background: #f25022; }
.ms-icon i:nth-child(2) { background: #7fba00; }
.ms-icon i:nth-child(3) { background: #00a4ef; }
.ms-icon i:nth-child(4) { background: #ffb900; }

.divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 0;
  color: #98a7b8;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .14em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e9f1;
}

.field-group {
  margin-bottom: 12px;
}

label {
  display: block;
  color: #273c58;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  margin-bottom: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.label-row label { margin: 0; }

.label-row a {
  color: var(--blue);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
}

.label-row a:hover {
  text-decoration: underline;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: #7890aa;
  font-size: 17px;
  z-index: 1;
}

.input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--navy);
  background: #fbfdff;
  font-size: 13.5px;
  transition: .2s ease;
}

.input-wrap input::placeholder { color: #a0afbf; font-size: 13px; }

.input-wrap input:focus {
  border-color: #51a4f5;
  box-shadow: 0 0 0 3px rgba(8,119,238,.12);
  background: #fff;
}

.eye-btn {
  position: absolute;
  right: 12px;
  border: 0;
  background: transparent;
  color: #8194aa;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.form-options {
  margin: 10px 0 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #5f728b;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}

.signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(135deg, #0877ee, #0758c7);
  box-shadow: 0 8px 18px rgba(8,119,238,.20);
}

.signin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(8,119,238,.26);
}

.security-note {
  margin-top: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6c8098;
  font-size: 9.5px;
  border-radius: 9px;
  background: #f4f9fd;
}

.shield {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0877ee;
  background: #e4f2ff;
  font-size: 11px;
}

.login-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e7edf3;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8999aa;
  font-size: 8.5px;
}

.login-footer div {
  display: flex;
  gap: 10px;
}

.login-footer a {
  color: #70849a;
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--blue);
}

/* Alert & Validation Integration */
.alert-custom {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.alert-danger-custom {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-danger-custom i {
  color: #dc2626;
  font-size: 14px;
  flex-shrink: 0;
}

.alert-success-custom {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-success-custom i {
  color: #16a34a;
  font-size: 14px;
  flex-shrink: 0;
}

.validation-error {
  color: #dc2626;
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.text-decoration-none {
  text-decoration: none !important;
}

/* Responsive Handling & Screen Media Optimization */
@media (max-width: 1200px) {
  .login-page { grid-template-columns: 48% 52%; }
  .brand-content { padding: 24px 32px; }
  .login-card { padding: 24px 28px 20px; }
}

/* Compact Media for standard laptops (1366x768 / 1280x720) */
@media (max-height: 760px) and (min-width: 901px) {
  .brand-content {
    padding: 20px 36px;
  }
  .brand-logo {
    max-width: 340px;
    max-height: 82px;
    margin-bottom: 8px;
  }
  .hero-copy h1 {
    font-size: 32px;
    line-height: 1.12;
  }
  .hero-copy p {
    font-size: 13.5px;
    margin-top: 8px;
    line-height: 1.48;
  }
  .feature-grid {
    margin-top: 14px;
    gap: 10px;
  }
  .feature {
    min-height: 88px;
    padding: 11px 8px;
    border-radius: 14px;
  }
  .feature .icon {
    width: 32px;
    height: 32px;
    font-size: 17px;
    margin-bottom: 4px;
  }
  .feature strong {
    font-size: 11.5px;
  }
  .feature span {
    font-size: 9.5px;
  }
  .brand-footer {
    margin-top: 8px;
    font-size: 9px;
  }
  .form-panel {
    padding: 14px 24px;
  }
  .login-card {
    padding: 20px 28px 16px;
  }
  .login-header h2 {
    font-size: 22px;
  }
  .login-header p {
    font-size: 12.5px;
    margin-bottom: 10px;
  }
  .m365-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  .divider {
    margin: 10px 0;
    font-size: 9.5px;
  }
  .field-group {
    margin-bottom: 10px;
  }
  .field-group label {
    font-size: 9.5px;
    margin-bottom: 4px;
  }
  .form-control-input {
    padding: 8px 12px 8px 36px;
    font-size: 13px;
  }
  .input-icon {
    font-size: 15px;
    left: 12px;
  }
  .signin-btn {
    padding: 10px;
    font-size: 13.5px;
  }
  .security-note {
    margin-top: 8px;
    font-size: 10px;
  }
  .login-footer {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 8px;
  }
}

/* Tablet & Smaller Screen Viewports */
@media (max-width: 900px), (max-height: 560px) {
  html, body {
    overflow-y: auto;
    height: auto;
  }

  .login-page {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .brand-panel { display: none; }

  .form-panel {
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
    padding: 32px 18px;
  }

  .login-card {
    padding: 28px 24px 22px;
    border-radius: 20px;
    margin: 0 auto;
    max-width: 440px;
  }

  .mobile-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
  }

  .mobile-logo {
    width: min(240px, 80%);
    height: auto;
    mix-blend-mode: multiply;
  }

  .login-header h2 { font-size: 24px; }

  .login-footer {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 8px;
  }
}

/* Mobile Screen Viewports */
@media (max-width: 480px) {
  .form-panel {
    padding: 20px 12px;
  }

  .login-card {
    padding: 22px 16px 18px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(16,56,96,.08);
  }

  .login-header h2 {
    font-size: 21px;
  }

  .login-header p {
    font-size: 12px;
  }

  .m365-btn {
    font-size: 12.5px;
    padding: 10px 12px;
  }

  .signin-btn {
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
