/* ═══════════════════════════════════════════════════════════════
 *  SCS · หน้าเข้าสู่ระบบ + หน้าสาธารณะ (Premium Split Stage)
 *  Version: 1.0.0 · ครูวิรัตน์ หาดคำ · www.kruwirat.com
 * ═══════════════════════════════════════════════════════════════ */

.lf-stage {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 16px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(99, 102, 241, .35), transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(168, 85, 247, .3), transparent 42%),
    radial-gradient(circle at 72% 88%, rgba(14, 165, 233, .26), transparent 45%),
    linear-gradient(135deg, #0f172a, #1e1b4b 55%, #0f172a);
}
.lf-stage::before {
  content: ''; position: absolute; width: 620px; height: 620px;
  left: -180px; top: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .22), transparent 62%);
  filter: blur(40px); animation: floaty 14s ease-in-out infinite; pointer-events: none;
}
@keyframes floaty { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(40px, 30px); } }

.lf-shell {
  position: relative; z-index: 1; width: 100%; max-width: 1060px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 26px; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .45);
  animation: stageIn .5s cubic-bezier(.2, .9, .3, 1.05);
}
@keyframes stageIn { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }

/* ── แผงแบรนด์ (ซ้าย) ── */
.lf-brand { padding: 38px 34px; color: #e2e8f0; min-height: 560px; display: flex; flex-direction: column; }
.lf-brand-top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.lf-brand-logo {
  width: 56px; height: 56px; border-radius: 18px; flex: 0 0 56px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; box-shadow: 0 12px 30px rgba(99, 102, 241, .5);
}
.lf-brand-name { font-family: 'Kanit', sans-serif; font-size: 20px; font-weight: 700; color: #fff; }
.lf-brand-org { font-size: 12.5px; color: rgba(226, 232, 240, .7); }

.lf-tagline { font-family: 'Kanit', sans-serif; font-size: 27px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; color: #fff; }
.lf-tagline span {
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd, #f0abfc, #a5b4fc);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: shine 4s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.lf-tagline-sub { font-size: 13px; color: rgba(226, 232, 240, .72); margin-bottom: 24px; }

.lf-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.lf-feature {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px; padding: 11px 13px; transition: all .2s ease;
}
.lf-feature:hover { transform: translateX(4px); background: rgba(255, 255, 255, .1); }
.lf-feature-icon {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff;
}
.lf-feature-title { font-size: 13.5px; font-weight: 700; color: #fff; font-family: 'Kanit', sans-serif; }
.lf-feature-desc { font-size: 11.5px; color: rgba(226, 232, 240, .68); line-height: 1.5; }

.lf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; }
.lf-stat { text-align: center; }
.lf-stat-value {
  font-family: 'Kanit', sans-serif; font-size: 21px; font-weight: 800;
  background: linear-gradient(135deg, #a5b4fc, #f0abfc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lf-stat-label { font-size: 10.5px; color: rgba(226, 232, 240, .6); text-transform: uppercase; letter-spacing: .05em; }

/* ── การ์ดฟอร์ม (ขวา) ── */
.lf-card { padding: 38px 34px; background: rgba(255, 255, 255, .04); display: flex; flex-direction: column; justify-content: center; }
.lf-mini-brand { display: none; align-items: center; gap: 10px; margin-bottom: 20px; }
.lf-title { font-family: 'Kanit', sans-serif; font-size: 25px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.lf-sub { font-size: 13px; color: rgba(226, 232, 240, .7); margin-bottom: 22px; }

.lf-form { display: flex; flex-direction: column; gap: 14px; }
.lf-form.is-shake { animation: shake .45s ease; }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.lf-label { font-size: 12.5px; font-weight: 600; color: rgba(226, 232, 240, .85); margin-bottom: 5px; display: block; }
.lf-input-wrap { position: relative; }
.lf-input-wrap i.lf-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: rgba(148, 163, 184, .9); font-size: 15px; transition: color .18s ease; pointer-events: none;
}
.lf-input-wrap:focus-within i.lf-icon { color: #a5b4fc; }
.lf-input {
  width: 100%; padding: 12px 14px 12px 40px; border-radius: 13px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  color: #f1f5f9; font-size: 14px; font-family: inherit; transition: all .18s ease;
}
.lf-input::placeholder { color: rgba(148, 163, 184, .7); }
.lf-input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 4px rgba(99, 102, 241, .2); background: rgba(255, 255, 255, .1); }
.lf-input:-webkit-autofill { -webkit-text-fill-color: #f1f5f9; -webkit-box-shadow: 0 0 0 1000px #1e1b4b inset; }
.lf-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: rgba(148, 163, 184, .9);
  cursor: pointer; font-size: 15px; padding: 5px;
}
.lf-toggle:hover { color: #a5b4fc; }

.lf-caps {
  display: none; font-size: 11.5px; color: #fcd34d; align-items: center; gap: 5px; margin-top: 5px;
}
.lf-caps.is-on { display: flex; }

.lf-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: rgba(226, 232, 240, .8); cursor: pointer; }
.lf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lf-link { font-size: 12.5px; color: #a5b4fc; background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0; }
.lf-link:hover { color: #c7d2fe; }

.lf-submit {
  position: relative; width: 100%; height: 50px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-family: 'Kanit', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 12px 28px rgba(99, 102, 241, .38); transition: all .2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden;
}
.lf-submit:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(99, 102, 241, .48); }
.lf-submit:active { transform: translateY(0); }
.lf-submit[data-state] { pointer-events: none; }
.lf-submit[data-state="loading"] { background: linear-gradient(135deg, #475569, #334155); }
.lf-submit[data-state="success"] { background: linear-gradient(135deg, #10b981, #059669); }
.lf-submit[data-state="error"] { background: linear-gradient(135deg, #f43f5e, #e11d48); }

.lf-alert {
  display: flex; align-items: flex-start; gap: 9px;
  background: rgba(244, 63, 94, .15); border: 1px solid rgba(244, 63, 94, .3);
  color: #fecdd3; border-radius: 12px; padding: 11px 13px; font-size: 13px;
}
.lf-alert.is-success { background: rgba(16, 185, 129, .15); border-color: rgba(16, 185, 129, .3); color: #a7f3d0; }
.lf-alert.is-info { background: rgba(14, 165, 233, .15); border-color: rgba(14, 165, 233, .3); color: #bae6fd; }

/* ── การ์ดบัญชีทดลอง ── */
.lf-demo {
  margin-top: 20px; padding: 12px 10px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px dashed rgba(165, 180, 252, .25);
}
.lf-demo-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(226, 232, 240, .8); margin-bottom: 9px; }
.lf-demo-pill {
  margin-left: auto; padding: 2px 8px; border-radius: 99px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.lf-demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.lf-demo-card {
  padding: 9px 5px 7px; border-radius: 11px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all .18s ease; font-family: inherit; min-height: 66px; justify-content: center;
}
.lf-demo-card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .1); border-color: rgba(165, 180, 252, .4); }
.lf-demo-card.is-loading { opacity: .55; pointer-events: none; }
.lf-demo-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.lf-demo-card[data-role="admin"] .lf-demo-icon    { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.lf-demo-card[data-role="director"] .lf-demo-icon { background: linear-gradient(135deg, #ddd6fe, #a78bfa); color: #4c1d95; }
.lf-demo-card[data-role="academic"] .lf-demo-icon { background: linear-gradient(135deg, #bfdbfe, #60a5fa); color: #1e3a8a; }
.lf-demo-card[data-role="teacher"] .lf-demo-icon  { background: linear-gradient(135deg, #a7f3d0, #34d399); color: #065f46; }
.lf-demo-card[data-role="parent"] .lf-demo-icon   { background: linear-gradient(135deg, #fbcfe8, #f472b6); color: #831843; }
.lf-demo-role { font-size: 10.5px; font-weight: 700; color: #e2e8f0; }
.lf-demo-user { font-size: 9.5px; color: rgba(148, 163, 184, .85); font-family: ui-monospace, monospace; }
.lf-demo-note { font-size: 10.5px; color: rgba(148, 163, 184, .8); text-align: center; margin-top: 8px; }

/* ── footer ของหน้า login ── */
.lf-footer {
  position: relative; z-index: 1; margin-top: 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  font-size: 11.5px; color: rgba(226, 232, 240, .6);
}
.lf-footer a { color: rgba(165, 180, 252, .95); }
.lf-footer-dev { display: flex; align-items: center; gap: 9px; }
.lf-footer-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, .2); }

@media (max-width: 900px) {
  .lf-shell { grid-template-columns: 1fr; max-width: 460px; }
  .lf-brand { display: none; }
  .lf-mini-brand { display: flex; }
  .lf-card { padding: 30px 22px; }
  .lf-title { font-size: 22px; }
}
@media (max-width: 420px) {
  .lf-demo-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ หน้าประกาศสาธารณะ + หน้าแรก ═══ */
.pub-wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 60px; }
.pub-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.pub-head { background: var(--brand-grad); color: #fff; padding: 26px 24px; position: relative; overflow: hidden; }
.pub-head::before {
  content: ''; position: absolute; top: -60%; right: -6%; width: 240px; height: 240px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .2), transparent 62%);
}
.pub-head > * { position: relative; z-index: 1; }
.pub-title { font-family: 'Kanit', sans-serif; font-size: 21px; font-weight: 800; margin: 6px 0 4px; }
.pub-body { padding: 24px; font-size: 14.5px; line-height: 1.85; white-space: pre-wrap; color: var(--ink-soft); }
.pub-foot { padding: 18px 24px 24px; border-top: 1px solid var(--line); }

/* ═══════════════════════════════════════════════════
   หน้าประกาศสาธารณะ (ผู้ปกครอง)
   ═══════════════════════════════════════════════════ */
.pub-body { background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #ecfeff 100%); min-height: 100vh; }
.pub-stage { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 24px 14px 40px; }
.pub-card {
  width: 100%; max-width: 720px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .1); overflow: hidden;
}
.pub-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 22px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7); color: #fff;
}
.pub-logo {
  width: 44px; height: 44px; border-radius: 13px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .3); font-size: 21px;
}
.pub-org { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 16px; line-height: 1.25; }
.pub-sys { font-size: 11.5px; opacity: .88; }
.pub-body-wrap { padding: 22px; }
.pub-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe;
  border-radius: 99px; padding: 4px 12px; font-size: 11.5px; font-weight: 600; margin-bottom: 10px;
}
.pub-title { font-family: 'Kanit', sans-serif; font-size: 21px; font-weight: 800; margin: 0 0 8px; color: #0f172a; line-height: 1.35; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #64748b; margin-bottom: 14px; }
.pub-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pub-text {
  font-size: 15px; line-height: 1.85; color: #1e293b;
  border-top: 1px dashed #e2e8f0; padding-top: 14px; word-break: break-word; overflow-wrap: anywhere;
}
.pub-ack { padding: 20px 22px; background: #f8fafc; border-top: 1px solid #e2e8f0; }
.pub-ack-title { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 15px; color: #0f172a; display: flex; align-items: center; gap: 7px; }
.pub-ack-sub { font-size: 12px; color: #64748b; margin: 3px 0 12px; }
.pub-ack-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pub-acked {
  display: flex; align-items: center; gap: 12px; padding: 18px 22px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border-top: 1px solid #a7f3d0; color: #065f46;
}
.pub-acked i { font-size: 30px; }
.pub-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 22px; border-top: 1px solid #e2e8f0; font-size: 11.5px; color: #64748b; background: #fff;
}
.pub-foot a { color: #6366f1; text-decoration: none; font-weight: 600; }
.pub-foot a:hover { text-decoration: underline; }
@media (max-width: 540px) {
  .pub-ack-fields { grid-template-columns: 1fr; }
  .pub-title { font-size: 18px; }
  .pub-text { font-size: 14px; }
  .pub-stage { padding: 12px 10px 30px; }
  .pub-card { border-radius: 16px; }
}

/* โลโก้จริงในแผงแบรนด์หน้าเข้าสู่ระบบ */
.lf-brand-logo { overflow: hidden; }
.lf-brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
