* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  margin: 0;
  background: rgba(36, 34, 66, 0.86);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.header {
  background: #242242;
  color: white;
  padding: 12px 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header img {
  width: 112px;
  height: auto;
  max-height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.header-text {
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.header-text h1 {
  margin: 0;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #f6f8ff;
  white-space: nowrap;
}

.header-text p {
  display: block;
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: rgba(232, 237, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
}

.subtitle { font-style: normal; }

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  background: #fff;
  width: 420px;
  padding: 35px;
  margin: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.login-card h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
  color: #242242;
}

.login-card p {
  font-size: 13px;
  color: #666;
  margin: 0 0 20px 0;
}

.input-group {
  text-align: left;
  margin-bottom: 15px;
}

.input-group label {
  font-size: 13px;
  color: #666;
}

.input-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid #ccc;
  border-radius: 6px;
  padding: 0 17px;
  height: 48px;
  margin-top: 3px;
}

.input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.input-wrapper i {
  color: #000;
  margin-right: 10px;
  font-size: 20px;
}

.input-wrapper input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  height: 100%;
}

.eye { cursor: pointer; color: #777; }
.password-input { font-size: 16px; color: #777; }

.login-btn {
  width: 100%;
  padding: 17px;
  margin-top: 10px;
  background: #242242;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}

.login-btn:hover { background: #2f256c; }

.links {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  font-size: 12px;
}

.links a { text-decoration: none; color: #3f51b5; }
.links a:hover { text-decoration: underline; }

.footer {
  background: #242242;
  color: white;
  text-align: center;
  padding: 10px;
  font-size: 9px;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 400;
}

#authMessage {
  display: none;
  margin-top: 14px;
  padding: 11px 36px 11px 12px;
  background: #eef1fb;
  color: #2f3550;
  border-radius: 8px;
  border: 1px solid #d8deef;
  box-shadow: 0 2px 8px rgba(36, 34, 66, 0.12);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  position: relative;
  animation: slideIn 0.25s ease;
}

#authMessage.auth-loading {
  background: #eef1fb;
  color: #2f3550;
  border-color: #d8deef;
}

#authMessage.auth-success {
  background: #e9f9ef;
  color: #0f6b38;
  border-color: #c8ebd6;
}

#authMessage.auth-error {
  background: #fdecee;
  color: #91203b;
  border-color: #f6cfd7;
}

#authMessage .close-alert {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 15px;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#authMessage .close-alert:hover { opacity: 1; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar { display: none; }
html { -ms-overflow-style: none; scrollbar-width: none; }

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(14, 18, 38, 0.45);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 18px;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e1e6f2;
  box-shadow: 0 20px 50px rgba(15, 22, 49, 0.28);
  padding: 0;
  min-width: 460px;
  max-width: 98vw;
  width: 600px;
  position: relative;
  text-align: left;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #2e3552;
  cursor: pointer;
  font-weight: 700;
  opacity: 0.8;
  transition: background 0.2s, opacity 0.2s;
}

.modal-close:hover {
  opacity: 1;
  background: #edf1fb;
}

.help-modal-head {
  background: linear-gradient(135deg, #242242 0%, #1d275a 100%);
  padding: 30px 34px 24px;
  color: #f5f7ff;
}

.help-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
}

.help-modal-kicker i {
  font-size: 12px;
}

.modal-content h3 {
  margin: 12px 0 8px;
  font-size: 27px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.modal-content .modal-desc {
  font-size: 13px;
  color: rgba(237, 242, 255, 0.92);
  margin: 0;
  line-height: 1.5;
}

.help-modal-body {
  padding: 26px 30px 28px;
}

.help-modal-note {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #59607a;
}

.modal-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.modal-links li {
  margin: 0;
}

.help-link {
  border: 1px solid #e2e7f4;
  border-radius: 12px;
  text-decoration: none;
  color: #1f2745;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.help-link:hover {
  border-color: #bcc7e5;
  background: #f8faff;
  transform: translateY(-1px);
}

.help-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf1fb;
  color: #1f2d6a;
  font-size: 14px;
  flex-shrink: 0;
}

.help-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.help-label {
  font-size: 11px;
  font-weight: 700;
  color: #5a617b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-value {
  margin-top: 1px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2745;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header, .footer { display: none; }

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 26px;
  position: relative;
  overflow: hidden;
}

/* background: left=dark, right=white */
.main::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 72%; height: 100%;
  background: #E8E7E7;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
}

.auth-shell {
  width: min(1280px, 96vw);
  min-height: 620px;
  background: #242242;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
  display: flex;
  z-index: 1;
  animation: shellReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* LEFT = dark */
.left-panel {
  width: 50%;
  background: #242242;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.brand-block {
  text-align: center;
  color: #fff;
  animation: leftContentReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.brand-plate {
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.logo-e,
.logo-spes {
  height: clamp(76px, 12vw, 132px);
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)) contrast(1.06) saturate(1.08);
}

.logo-e {
  transform-origin: center bottom;
  animation: bounceE 1.4s ease-in-out infinite;
  margin-right: -8px;
}

.logo-spes {
  margin-left: -4px;
}

.logo-full {
  display: none;
  width: min(260px, 82vw);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)) contrast(1.06) saturate(1.08);
}

@keyframes bounceE {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-4px); }
}

.brand-title {
  margin: 14px 0 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f6f8ff;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-subtitle {
  margin: 4px 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: rgba(232, 237, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  font-style: normal;
}

/* RIGHT = white */
.right-panel {
  width: 50%;
  background: #ffffff;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 56px;
}

.right-panel .login-card {
  width: 100%;
  max-width: 340px;
  background: transparent;
  box-shadow: none;
  margin: 0; padding: 0;
  border-radius: 0;
  text-align: left;
  animation: rightContentReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.right-panel .login-card h2 {
  display: block;
  color: #242242;
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px;
  text-align: center;
}

.right-panel .login-card p {
  display: block;
  color: #666;
  font-size: 13px;
  margin: 0 0 18px;
  text-align: center;
}

.right-panel .input-group label {
  color: #555;
  font-size: 12px;
}

.right-panel .input-wrapper {
  background: #ffffff;
  border: 1px solid #cfd6e6;
  border-radius: 2px;
  padding: 8px 10px;
}

.right-panel .input-wrapper i {
  font-size: 14px;
  color: #3d4352;
  margin-right: 8px;
}

.right-panel .input-wrapper input { font-size: 12px; }

.row-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 8px 0 12px;
  gap: 8px;
}

.remember {
  color: #555;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.remember input {
  width: 14px; height: 14px;
  accent-color: #242242;
}

.right-panel .login-btn {
  padding: 17px;
  border-radius: 2px;
  margin-top: 10px;
  background: #242242;
  box-shadow: 0 4px 10px rgba(36, 34, 66, 0.28);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.right-panel .login-btn:hover {
  background: #2f2f5a;
  box-shadow: 0 6px 14px rgba(36, 34, 66, 0.35);
}

.right-panel .links { margin-top: 14px; }

.right-panel .links a {
  color: #3f51b5;
  font-size: 11px;
}

.right-panel #authMessage { margin-top: 14px; }

@keyframes shellReveal {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes leftContentReveal {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes rightContentReveal {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell,
  .brand-block,
  .right-panel .login-card {
    animation: none !important;
  }

  .logo-e {
    animation: none !important;
  }
}

/* mobile */
@media (max-width: 720px) {
  body {
    background: #ffffff;
    padding-bottom: 38px;
  }

  .main {
    min-height: 100dvh;
    padding: 15px 12px;
    align-items: center;
    justify-content: center;
    background: #E8E7E7;
  }

  .main::before {
    display: block;
    top: 0;
    right: 0;
    width: 100%;
    height: 58%;
    background: #242242;
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%);
  }

  .auth-shell {
    width: min(360px, 100%);
    min-height: auto;
    display: block;
    margin: 0 auto;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .left-panel, .right-panel {
    width: 100%;
    clip-path: none;
    background: transparent;
  }

  .left-panel {
    padding: 14px 8px 12px;
    justify-content: center;
  }

  .brand-block {
    width: 100%;
    text-align: center;
  }

  .brand-plate {
    display: block;
  }

  .logo-e {
    display: none;
  }

  .logo-spes {
    display: none;
  }

  .logo-full {
    display: block;
    margin: 0 auto;
    width: min(230px, 78vw);
  }

  .brand-title,
  .brand-subtitle {
    display: block;
    text-align: center;
    white-space: normal;
  }

  .brand-title {
    margin: 12px 0 0px;
    font-size: 11px;
    letter-spacing: 0.06em;
    line-height: 1.25;
    color: #ffffff;
  }

  .brand-subtitle {
    margin: 0;
    font-size: 9px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    color: #f1f4ff;
  }

  .right-panel {
    padding: 15px;
  }

  .right-panel .login-card {
    max-width: 100%;
    margin: 0;
    background: #ffffff;
    border: none;
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 28px;
    text-align: left;
  }

  .right-panel .login-card h2 {
    font-size: 24px;
    margin: 0 0 2px;
    text-align: center;
  }

  .right-panel .login-card p {
    font-size: 11px;
    margin: 0 0 12px;
    text-align: center;
  }

  .input-group {
    margin-bottom: 13px;
  }

  .input-group label {
    font-size: 11px;
  }

  .right-panel .input-wrapper {
    border: 1px solid #ced4e3;
    border-radius: 0;
    padding: 14px;
    min-height: unset;
    margin-top: 3px;
  }

  .right-panel .input-wrapper i {
    font-size: 16px;
    margin-right: 10px;
  }

  .right-panel .input-wrapper input {
    font-size: 12px;
  }

  .row-meta {
    margin: 6px 0 8px;
    gap: 8px;
  }

  .remember {
    font-size: 11px;
  }

  .remember input {
    width: 12px;
    height: 12px;
  }

  .right-panel .login-btn {
    padding: 14px;
    margin-top: 8px;
    border-radius: 0;
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .right-panel .links {
    margin-top: 13px;
    font-size: 10px;
  }

  .right-panel .links a {
    font-size: 10px;
  }

  #authMessage {
    padding: 10px 12px;
    font-size: 11px;
    margin-top: 16px;
  }

  .close-alert { font-size: 14px; right: 10px; }
  .footer {
    display: block;
    padding: 8px;
    font-size: 8px;
    background: #242242;
    color: #ffffff;
    text-align: center;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 400;
  }
  .modal {
    padding: 14px;
  }

  .modal-content {
    min-width: unset;
    width: 92vw;
    border-radius: 14px;
  }

  .help-modal-head {
    padding: 24px 20px 20px;
  }

  .modal-content h3 {
    font-size: 22px;
    margin-top: 10px;
  }

  .help-modal-body {
    padding: 18px 16px 20px;
  }

  .help-link {
    padding: 11px 12px;
    gap: 10px;
  }

  .help-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 12px;
  }

  .help-value {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .main {
    padding: 22px 10px 22px;
  }

  .auth-shell {
    width: min(340px, 100%);
  }

  .logo-e {
    display: none;
  }

  .logo-spes {
    display: none;
  }

  .logo-full {
    width: min(210px, 74vw);
  }

  .brand-title {
    font-size: 10px;
  }

  .brand-subtitle {
    font-size: 8px;
  }

  .right-panel .login-card {
    padding: 18px 14px 14px;
  }

  .right-panel .login-card h2 {
    font-size: 21px;
  }
}