@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap');

:root {
  --blue-900: #042C53;
  --blue-800: #0C447C;
  --blue-700: #185FA5;
  --blue-600: #1E6FBB;
  --blue-500: #2D87D9;
  --blue-400: #378ADD;
  --blue-200: #85B7EB;
  --blue-100: #B5D4F4;
  --blue-50: #E6F1FB;
  --blue-faint: #F0F7FF;
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #EEF2F6;
  --gray-200: #DDE5EE;
  --gray-400: #9BAEC8;
  --gray-600: #5E7896;
  --gray-800: #2C3E54;
  --text-dark: #0D2137;
  --text-mid: #2C4A6A;
  --text-muted: #6B8DAD;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(21, 80, 155, .08);
  --shadow-md: 0 6px 24px rgba(21, 80, 155, .14);
  --shadow-lg: 0 16px 48px rgba(21, 80, 155, .18);
  --t: 0.28s cubic-bezier(.4, 0, .2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  min-height: 100vh;
  background: var(--gray-50);
  display: flex;
  align-items: stretch;
  overflow-x: hidden;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0D2D5E 0%, #1565C0 40%, #1E88E5 70%, #2196F3 100%);
  z-index: 0;
}

.bg-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(255, 255, 255, .08) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 20%, rgba(100, 181, 246, .15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 90%, rgba(21, 101, 192, .25) 0%, transparent 50%);
}

.bg-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, .06) 1px, transparent 0);
  background-size: 36px 36px;
}

.page-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  min-height: 100vh;
}

/* ─── LEFT PANEL ─── */
.left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
}

.left-panel::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 70px solid rgba(255, 255, 255, .05);
  pointer-events: none;
}

.left-panel::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 50px solid rgba(255, 255, 255, .04);
  pointer-events: none;
}

/* ─── BRAND LOGO ─── */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 52px;
  animation: fadeUp .5s ease .1s both;
}

.logo-img-wrap {
  width: 56px;
  height: 56px;
  background: var(--white);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
  overflow: hidden;
  padding: 6px;
}

.logo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-family: 'Roboto', sans-serif;
  color: var(--white);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-name small {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ─── HEADLINE ─── */
.left-headline {
  font-family: 'Roboto', sans-serif;
  color: var(--white);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.18;
  margin-bottom: 20px;
  letter-spacing: -.01em;
  animation: fadeUp .5s ease .2s both;
}

.left-headline em {
  font-style: italic;
  color: rgba(255, 255, 255, .75);
}

.left-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, .6);
  line-height: 1.7;
  max-width: 420px;
  margin-bottom: 52px;
  animation: fadeUp .5s ease .3s both;
}

/* ─── STATS ─── */
.stats-row {
  display: flex;
  gap: 16px;
  animation: fadeUp .5s ease .4s both;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  padding: 14px 20px;
  backdrop-filter: blur(4px);
}

.stat-pill-val {
  font-family: 'Roboto', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-pill-label {
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ─── RIGHT PANEL ─── */
.right-panel {
  width: 500px;
  min-width: 420px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 48px;
  position: relative;
  overflow-y: auto;
  animation: slideIn .5s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, .1);
}

.right-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-800), var(--blue-500), var(--blue-200));
}

/* ─── LOGO IN RIGHT PANEL (mobile) ─── */
.right-logo {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  animation: fadeUp .4s ease .1s both;
}

.right-logo-img {
  width: 44px;
  height: 44px;
  background: var(--blue-faint);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--blue-100);
}

.right-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.right-logo-name {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--blue-800);
  line-height: 1.2;
}

.right-logo-name small {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ─── FORM HEADER ─── */
.form-header {
  margin-bottom: 32px;
}

.form-header h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.form-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── FORM CONTROLS ─── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  transition: color var(--t);
}

.input-icon .material-icons {
  font-size: 20px;
}

.form-control {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0 44px 0 46px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--blue-faint);
  outline: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.form-control:focus {
  border-color: var(--blue-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(55, 138, 221, .12);
}

.form-control.error {
  border-color: #C62828;
  background: #fff8f8;
}

.input-wrap:focus-within .input-icon {
  color: var(--blue-500);
}

.toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color var(--t);
}

.toggle-pw:hover {
  color: var(--blue-700);
}

.toggle-pw .material-icons {
  font-size: 20px;
}

/* ─── ERRORS ─── */
.field-error {
  font-size: 12px;
  color: #C62828;
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 4px;
}

.field-error.show {
  display: flex;
}

.field-error .material-icons {
  font-size: 14px;
}

/* ─── FORM META ─── */
.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.remember-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-mid);
  user-select: none;
}

.custom-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: 5px;
  background: var(--blue-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t);
}

#rememberCheck {
  display: none;
}

#rememberCheck:checked+label .custom-check {
  background: var(--blue-700);
  border-color: var(--blue-700);
}

#rememberCheck:checked+label .custom-check::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg) translate(1px, -1px);
}

.forgot-link {
  font-size: 13px;
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t);
}

.forgot-link:hover {
  color: var(--blue-800);
  text-decoration: underline;
}

/* ─── BUTTON ─── */
.btn-login {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-500) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .02em;
  transition: box-shadow var(--t), transform var(--t), filter var(--t);
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(24, 95, 165, .3);
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .1) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .6s ease;
}

.btn-login:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 28px rgba(24, 95, 165, .4);
  transform: translateY(-1px);
}

.btn-login:hover::before {
  transform: translateX(100%);
}

.btn-login:active {
  transform: scale(.98);
}

.btn-login .material-icons {
  font-size: 18px;
}

.btn-login.loading {
  filter: brightness(.85);
  pointer-events: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

.btn-login.loading .btn-text {
  display: none;
}

.btn-login.loading .spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── DIVIDER ─── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ─── FOOTER ─── */
.form-footer {
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--blue-600);
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* ─── FLASH ERROR ─── */
.flash-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #FFEBEE;
  color: #C62828;
  font-size: 13px;
  line-height: 1.6;
  border-left: 3px solid #C62828;
}

/* ─── ANIMATIONS ─── */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

.shake {
  animation: shake .35s ease;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  body {
    align-items: flex-start;
    overflow: auto;
    background: linear-gradient(160deg, #0D2D5E 0%, #1565C0 50%, #1E88E5 100%);
  }

  .bg-gradient {
    display: none;
  }

  .page-wrap {
    flex-direction: column;
    min-height: 100vh;
  }

  .left-panel {
    padding: 36px 28px 28px;
    flex: none;
  }

  .left-headline {
    font-size: 30px;
  }

  .left-desc {
    margin-bottom: 32px;
  }

  .right-panel {
    width: 100%;
    min-width: 0;
    padding: 40px 28px 52px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .12);
    animation: slideUp .5s cubic-bezier(.4, 0, .2, 1);
  }

  .right-panel::before {
    display: none;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(24px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 640px) {
  .left-panel {
    display: none;
  }

  body {
    align-items: stretch;
  }

  .page-wrap {
    flex-direction: column;
  }

  .right-panel {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 48px 24px 60px;
    border-radius: 0;
    justify-content: center;
    box-shadow: none;
    animation: fadeUp .4s ease;
  }

  .right-logo {
    display: flex;
  }

  .form-header h2 {
    font-size: 24px;
  }

  .stats-row {
    gap: 10px;
  }

  .stat-pill {
    padding: 10px 14px;
  }

  .stat-pill-val {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .right-panel {
    padding: 40px 20px 56px;
  }
}
