/* login.css — หน้าเข้าสู่ระบบ / สมัครสมาชิก · คู่กับ login.js */
#app.auth {
  max-width: none;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.au-wrap {
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  position: relative;
}
.au-card {
  width: min(94vw, 430px);
  background: linear-gradient(#4a2c16f2, #2a160cf2);
  border: 3px solid #e8c48a;
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow:
    0 10px 0 #0005,
    0 0 40px #0008;
  color: #3b4255; /* พื้นครีมจากกรอบซากุระ (Theme/sakura-kit.css) → ตัวอักษรเข้มแบบหน้าต่างในเกม */
}
.au-logo {
  text-align: center;
  line-height: 1.1;
  margin-top: -6px;
  margin-bottom: 6px;
}
.au-logo .au-logo-img {
  max-width: 290px;
  max-height: 145px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}
.au-tabs {
  display: flex;
  gap: 6px;
  margin: 6px 0 12px;
  background: #8a6d3b1f;
  border-radius: 99px;
  padding: 4px;
}
.au-tabs button {
  flex: 1;
  border: 0;
  border-radius: 99px;
  padding: 9px 0;
  background: transparent;
  color: #7d8394;
  font:
    700 15px Sarabun,
    sans-serif;
  cursor: pointer;
}
.au-tabs button.on {
  background: linear-gradient(#f0b66a, #c98036);
  color: #3b1d0a;
  box-shadow: 0 2px 0 #7a4a1a;
}
.au-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* กลุ่มช่องกรอก / กลุ่มปุ่ม (login.js) — ระยะห่างเท่ากับของฟอร์ม (inherit ตามหน้าจอ) */
.au-main,
.au-side {
  display: flex;
  flex-direction: column;
  gap: inherit;
}
.au-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.au-form label > span {
  font:
    700 13px Sarabun,
    sans-serif;
  color: #8a6d3b;
}
.au-form input:not([type='checkbox']) {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 2px solid #d9cfc0;
  background: #fff;
  color: #3b4255;
  font:
    700 16px Sarabun,
    sans-serif;
  outline: none;
}
.au-form input:focus {
  border-color: #e0a521;
  box-shadow: 0 0 0 3px #e0a52144;
}
.au-form input:disabled {
  opacity: 0.6;
}
.au-form .au-show {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font:
    600 13px Sarabun,
    sans-serif;
  color: #5b6275;
  cursor: pointer;
}
.au-go {
  margin-top: 4px;
  padding: 13px;
  border-radius: 14px;
  border: 2px solid #8a1f45;
  background: linear-gradient(#f48fb1, #d6336c);
  color: #fff;
  font:
    700 17px Sarabun,
    sans-serif;
  text-shadow: 0 1px 0 #8a1f45;
  box-shadow: 0 4px 0 #8a1f45;
  cursor: pointer;
}
.au-go:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #8a1f45;
}
.au-go:disabled {
  opacity: 0.65;
  cursor: default;
}
.au-err {
  margin: 2px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fdecee;
  border: 1px solid #e8a0a8;
  color: #c8424f;
  font:
    600 13.5px/1.35 Sarabun,
    sans-serif;
}
.au-hint {
  display: block;
  text-align: center;
  color: #7d8394;
  font-size: 12px;
  line-height: 1.35;
}
.au-load {
  text-align: center;
  color: #8a6d3b;
  font:
    700 16px Sarabun,
    sans-serif;
  padding: 18px 0;
}
.au-ver {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: #fff8;
  font:
    12px Sarabun,
    sans-serif;
}
/* การ์ดสูงกว่าจอ (มือถือแนวนอนหลังเพิ่มปุ่ม Google) → ถ้า #app จัดกึ่งกลางเอง หัวการ์ดจะล้นขึ้นบนจนเลื่อนไปดูไม่ได้
   .au-wrap สูงอย่างน้อยเต็มจอและจัดการ์ดกึ่งกลางอยู่แล้ว จึงให้ #app เริ่มจากด้านบนแทน */
#app.auth {
  align-items: flex-start;
}
/* เส้นคั่น "หรือ" + ปุ่มเข้าสู่ระบบด้วย Google (พื้นขาว โลโก้สี่สี ตามแนวทางปุ่มของ Google) */
.au-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  color: #7d8394;
  font:
    600 12.5px Sarabun,
    sans-serif;
}
.au-or::before,
.au-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #8a6d3b44;
}
.au-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font:
    700 15.5px Sarabun,
    sans-serif;
  box-shadow: 0 3px 0 #0002;
  cursor: pointer;
}
.au-google .au-g {
  width: 20px;
  height: 20px;
  flex: none;
}
.au-google:hover {
  background: #f8f9fa;
}
.au-google:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0002;
}
.au-google:disabled {
  opacity: 0.65;
  cursor: default;
}
@media (max-height: 520px) {
  .au-or {
    display: none; /* จอเตี้ย: ประหยัดความสูง ปุ่มขาวแยกจากปุ่มชมพูชัดอยู่แล้ว */
  }
  .au-google {
    padding: 7px 12px;
  }
  .au-logo .au-logo-img {
    max-height: 90px;
    max-width: 220px;
  }
  .au-card {
    padding: 10px 14px;
  }
  .au-form {
    gap: 6px;
  }
  .au-form input:not([type='checkbox']) {
    padding: 7px 10px;
  }
}

/* ===== จอแนวนอน: การ์ดกว้าง 2 คอลัมน์ ให้เห็นครบในจอเดียวไม่ต้องเลื่อน =====
   ซ้าย = แท็บ + ช่องกรอก (สูงสุด 4 ช่องตอนสมัคร) · ขวา = โลโก้ + ปุ่มเข้าสู่ระบบ + ปุ่ม Google + คำแนะนำ
   .au-form ใช้ display: contents → กลุ่ม au-main/au-side กลายเป็นช่องในกริดของการ์ดโดยตรง (ฟอร์มยังกด Enter ส่งได้ตามเดิม) */
@media (min-aspect-ratio: 4/3) and (min-width: 600px) {
  .au-card {
    width: min(94vw, 780px);
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      'main logo'
      'main side';
    column-gap: 26px;
    align-items: start;
  }
  .au-form {
    display: contents;
  }
  .au-logo {
    grid-area: logo;
    margin-top: -10px;
  }
  .au-main {
    grid-area: main;
  }
  .au-side {
    grid-area: side;
    align-self: center;
  }
  .au-load {
    grid-column: 1 / -1;
  }
  .au-tabs {
    margin-top: 0;
  }
}
/* แนวนอน + จอเตี้ย (มือถือ): ลดขอบนอกและช่องไฟ ให้หน้าสมัคร 4 ช่องพอดีความสูงจอ */
@media (min-aspect-ratio: 4/3) and (min-width: 600px) and (max-height: 520px) {
  .au-wrap {
    padding: 8px 14px;
  }
  .au-tabs {
    margin-bottom: 4px;
  }
  .au-tabs button {
    padding: 6px 0;
  }
  .au-form label {
    gap: 2px;
  }
  .au-form input:not([type='checkbox']) {
    padding: 6px 10px;
    font-size: 15px;
  }
  .au-go {
    margin-top: 0;
    padding: 10px;
  }
}

/* ข้อตกลงตอนสมัคร (login.js termsHtml) */
.au-terms {
  padding: 8px 10px;
  border: 1px solid #ecd9b0;
  border-radius: 10px;
  background: #fffaf0;
}
.au-terms p {
  margin: 0 0 6px;
  color: #5b6275;
  font:
    500 12.5px/1.45 Sarabun,
    sans-serif;
}
.au-terms .au-show {
  align-items: flex-start;
}
.au-terms a {
  color: #b8862b;
}
