@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --blue-900: #0b2b52;
  --blue-800: #123e73;
  --blue-700: #17558f;
  --blue-600: #1e6bb0;
  --blue-500: #2f86d1;
  --blue-100: #e5f0fb;
  --blue-50: #f3f8fd;
  --ink: #1a2432;
  --ink-soft: #536173;
  --line: #d7e2ee;
  --white: #ffffff;
  --red: #b32c2c;
  --red-bg: #fdeaea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 43, 82, .06), 0 18px 44px rgba(11, 43, 82, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Sarabun', 'Leelawadee UI', 'Tahoma', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 8% -10%, rgba(47, 134, 209, .28), transparent 60%),
    radial-gradient(900px 460px at 105% 110%, rgba(23, 85, 143, .3), transparent 62%),
    linear-gradient(160deg, var(--blue-900), var(--blue-700) 58%, var(--blue-600));
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
}

.login-wrap {
  width: min(940px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 0;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- ซีกซ้าย: แบรนด์ ---------- */
.login-aside {
  background: linear-gradient(150deg, var(--blue-900), var(--blue-700) 62%, var(--blue-600));
  color: var(--white);
  padding: 42px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  overflow: hidden;
}

.login-aside::after {
  content: '';
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}

.brand { display: flex; align-items: center; gap: 14px; position: relative; }

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .32);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .5px;
  flex: none;
}

.brand h1 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.4;
}

.brand p {
  margin: 3px 0 0;
  font-size: .84rem;
  color: rgba(255, 255, 255, .78);
}

.aside-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.aside-points li {
  display: flex;
  gap: 12px;
  font-size: .89rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .9);
}

.aside-points .num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  display: grid;
  place-items: center;
  font-size: .76rem;
  font-weight: 700;
}

.aside-foot {
  font-size: .76rem;
  color: rgba(255, 255, 255, .62);
  position: relative;
}

/* ---------- ซีกขวา: ฟอร์ม ---------- */
.login-main {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-main h2 {
  margin: 0 0 6px;
  font-size: 1.32rem;
  color: var(--blue-900);
  font-weight: 600;
}

.login-main .sub {
  margin: 0 0 24px;
  font-size: .88rem;
  color: var(--ink-soft);
}

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }

.field label {
  font-size: .84rem;
  font-weight: 600;
  color: var(--blue-800);
}

input {
  font-family: inherit;
  font-size: .96rem;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  min-height: 46px;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(47, 134, 209, .18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .97rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: var(--white);
  min-height: 48px;
  margin-top: 6px;
  transition: filter .15s ease, transform .05s ease;
}

.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: #b7c5d5; cursor: not-allowed; filter: none; }

.alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .86rem;
  margin-bottom: 16px;
  display: none;
}

.alert.show { display: block; }
.alert.error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #f3c7c7;
}

.hint-foot {
  margin: 18px 0 0;
  font-size: .78rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- ปุ่ม Google ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--ink-soft);
  font-size: .8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid #dadce0;
  background: var(--white);
  color: #3c4043;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #c6cbd1;
  box-shadow: 0 1px 3px rgba(60, 64, 67, .18);
}

.btn-google:active { transform: translateY(1px); }

.google-logo { flex: none; }

.btn-google.is-disabled,
.btn-google[aria-disabled='true'] {
  background: #f1f3f4;
  color: #9aa0a6;
  border-color: #e0e3e7;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

.btn-google.is-disabled .google-logo,
.btn-google[aria-disabled='true'] .google-logo {
  filter: grayscale(1);
  opacity: .55;
}

.google-hint {
  margin: 8px 0 0;
  font-size: .76rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
}

.google-hint:empty { display: none; }

.google-hint.warn { color: #a35a00; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  body { padding: 18px 12px; }

  .login-wrap { grid-template-columns: 1fr; }

  .login-aside { padding: 28px 24px; gap: 22px; }
  .aside-points { display: none; }

  .login-main { padding: 30px 24px 34px; }
}
