@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    'Kanit',
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f8fafc;
  color: #0f172a;
}

.login-container {
  width: 100%;
  max-width: 960px;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

.login-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px;
  color: #ffffff;
}

.login-banner::before,
.login-banner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.login-banner::before {
  width: 260px;
  height: 260px;
  top: -80px;
  right: -80px;
}

.login-banner::after {
  width: 180px;
  height: 180px;
  bottom: -70px;
  left: -60px;
}

.banner-content {
  position: relative;
  z-index: 1;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 28px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.logo img {
  border-radius: 8px;
}

.login-banner h1 {
  margin-bottom: 18px;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.2;
}

.login-banner p {
  max-width: 440px;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
}

/* Form Section */
.login-form-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 45px;
  background: #ffffff;
}

.login-form-wrapper {
  width: 100%;
  max-width: 360px;
}

.login-form-wrapper h2 {
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 600;
  color: #0f172a;
}

.subtitle {
  margin-bottom: 30px;
  font-size: 14px;
  color: #64748b;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 46px;
  font-size: 14.5px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 16px;
  color: #94a3b8;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 15px;
  padding: 5px;
  transform: translateY(-50%);
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
}

.password-input {
  padding-right: 48px !important;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 4px 0 24px;
  font-size: 13.5px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  cursor: pointer;
}

.remember-me input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  border-radius: 4px;
}

.forgot-password {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
}

.login-button {
  width: 100%;
  height: 50px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #2563eb;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.login-button:active {
  transform: translateY(0);
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
  font-size: 13px;
  color: #94a3b8;
}

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

.register-text {
  font-size: 14px;
  text-align: center;
  color: #64748b;
}

.register-text a {
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

@media (max-width: 850px) {
  .login-container {
    grid-template-columns: 1fr;
  }
  .login-banner {
    display: none;
  }
}

.register-text a:hover {
  text-decoration: underline;
}

.download-text {
  font-size: 14px;
  text-align: center;
  color: #727d90;
}

.download-text a {
  font-weight: 700;
  color: #007fc5;
  text-decoration: none;
}

.download-text a:hover {
  text-decoration: underline;
}

.copyright {
  margin-top: 35px;
  font-size: 12px;
  text-align: center;
  color: #a0a8b6;
}

/* รองรับมือถือ */
@media (max-width: 768px) {
  body {
    padding: 0;
    background: #ffffff;
  }

  .login-container {
    max-width: none;
    min-height: 100vh;
    grid-template-columns: 1fr;
    border-radius: 0;
    box-shadow: none;
  }

  .login-banner {
    min-height: 260px;
    padding: 40px 30px;
  }

  .logo {
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    font-size: 25px;
    border-radius: 15px;
  }

  .login-banner h1 {
    font-size: 30px;
  }

  .login-banner p {
    font-size: 15px;
    line-height: 1.65;
  }

  .login-form-section {
    padding: 45px 25px;
  }

  .login-form-wrapper {
    max-width: 430px;
  }
}

@media (max-width: 420px) {
  .login-banner {
    min-height: 230px;
    padding: 32px 24px;
  }

  .login-banner h1 {
    font-size: 27px;
  }

  .login-banner p {
    font-size: 14px;
  }

  .login-form-section {
    padding: 38px 22px;
  }

  .login-form-wrapper h2 {
    font-size: 27px;
  }

  .form-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
