@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root { color-scheme: light; --ink: #17231d; --muted: #66736b; --green: #16784a; --line: #e2e9e3; }
* { box-sizing: border-box; }
body { margin: 0; background: #f3f7f3; color: var(--ink); font-family: 'DM Sans', sans-serif; }
.page { width: min(1040px, calc(100% - 32px)); margin: 42px auto; }
.auth-page { width: min(560px, calc(100% - 32px)); }
.hero { padding: 25px 36px 34px; border-radius: 20px; color: white; background: linear-gradient(120deg, #103f31, #197b50 70%, #268d61); box-shadow: 0 16px 36px #155b3924; }
.hero.house-theme-red { background: linear-gradient(120deg, #641d29, #a82e3d 70%, #c74850); }
.hero.house-theme-blue { background: linear-gradient(120deg, #12345f, #185c9b 70%, #3486bd); }
.hero.house-theme-green { background: linear-gradient(120deg, #12442f, #16784a 70%, #279366); }
.hero.house-theme-gold { background: linear-gradient(120deg, #654400, #936700 70%, #ad8319); }
.hero.house-theme-orange { background: linear-gradient(120deg, #69300d, #a54d17 70%, #c66a24); }
.hero.house-theme-purple { background: linear-gradient(120deg, #382252, #63408a 70%, #835fa7); }
.school-brand { display: flex; align-items: center; gap: 13px; padding-bottom: 19px; border-bottom: 1px solid #ffffff38; }
.school-logo { width: 46px; height: 46px; display: grid; flex: 0 0 46px; place-items: center; border: 1px solid #ffffff85; border-radius: 14px; background: #ffffff18; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.school-brand-copy { display: grid; gap: 4px; min-width: 0; }
.school-brand-copy strong { font-family: 'Manrope', sans-serif; font-size: clamp(14px, 2.5vw, 17px); }
.school-brand-copy small { color: #d2ede0; font-size: 12px; letter-spacing: .04em; }
.header-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.header-house { display: inline-flex; min-height: 38px; align-items: center; padding: 7px 12px; border: 1px solid #ffffff75; border-radius: 999px; background: #ffffff1c; color: white; font-size: 13px; font-weight: 700; white-space: nowrap; }
.header-logout { min-height: 38px; margin: 0; padding: 7px 12px; border: 1px solid #ffffff95; border-radius: 9px; background: #ffffff; color: #24372c; font-size: 13px; font-weight: 700; white-space: nowrap; }
.header-logout:hover { background: #eef4f0; }
.hero-admin-link { display: inline-flex; min-height: 38px; align-items: center; margin-left: auto; padding: 7px 13px; border: 1px solid #ffffff70; border-radius: 8px; color: white; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hero-admin-link:hover { background: #ffffff1a; }
.hero-copy { padding-top: 26px; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .16em; opacity: .82; }
h1, h2 { font-family: 'Manrope', sans-serif; }
h1 { margin: 0; font-size: clamp(34px, 7vw, 48px); letter-spacing: -.04em; }
.hero-copy > p:last-child { margin: 8px 0 0; color: #e2f4e9; }
.card { margin-top: 20px; padding: 28px 32px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 5px 18px #1b42210a; }
h2 { margin: 0 0 20px; font-size: 20px; letter-spacing: -.025em; }
form { display: grid; gap: 16px; }
.house-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; max-width: 540px; }
.house-form button { min-width: 140px; }
.intro { margin: -8px 0 20px; color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-title h2 { margin: 0; }
.house-chip { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.house-chip strong { color: var(--green); }
.change-house { color: var(--green); font-size: 14px; font-weight: 700; text-decoration: none; }
.change-house:hover { text-decoration: underline; }
.lookup-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; margin-bottom: 18px; }
.lookup-form button { min-width: 132px; }
.form-actions, .row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logout-form { margin: 0; }
.row-actions form { display: block; margin: 0; }
.category-line { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.category-line strong { padding: 5px 10px; border-radius: 999px; background: #e8f7ee; color: #12633c; font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border-radius: 9px; background: var(--green); color: #fff; font: inherit; font-weight: 700; text-decoration: none; }
.button.secondary { border: 1px solid #d7e0d9; background: #fff; color: #344239; }
.button.small, button.small { min-height: 36px; padding: 7px 10px; font-size: 13px; }
.student-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 18px; padding: 14px; border-radius: 10px; background: #f3f7f3; color: var(--ink); font-size: 14px; }
.student-summary span { display: grid; gap: 4px; }
.student-summary b { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
label { display: grid; gap: 7px; color: #344239; font-size: 14px; font-weight: 600; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d7e0d9; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-weight: 400; }
input:focus, select:focus { outline: 3px solid #19774a2b; border-color: var(--green); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row.three { grid-template-columns: repeat(3, 1fr); }
.optional { color: #849087; font-size: 12px; font-weight: 400; }
button { min-height: 46px; margin-top: 2px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:hover { background: #105f3b; }
button.secondary { border: 1px solid #d7e0d9; background: #fff; color: #344239; }
button.secondary:hover { background: #f4f7f4; }
.auth-card { padding: 28px 32px; }
.auth-form { gap: 17px; }
.auth-form button { width: 100%; }
.resend-form { margin-top: 12px; text-align: center; }
.link-button { padding: 7px; border: 0; background: transparent; color: var(--green); }
.link-button:hover { background: transparent; text-decoration: underline; }
.notice { padding: 12px 14px; border-radius: 9px; font-size: 14px; }
.success { margin: -4px 0 18px; background: #e8f7ee; color: #12633c; }
.error { margin: -4px 0 18px; background: #fff0ed; color: #9c3024; }
.error ul { margin: 0; padding-left: 19px; }
.list-card { padding-bottom: 18px; }
.list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-heading h2 { margin-bottom: 16px; }
.list-heading span, .empty, footer { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
.category-group + .category-group { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.category-group h3 { margin: 0 0 14px; color: var(--green); font-family: 'Manrope', sans-serif; font-size: 18px; }
.category-group h4 { margin: 16px 0 6px; font-size: 15px; }
.category-group h4 span { color: var(--muted); font-size: 13px; font-weight: 500; }
.student-photo { display: block; width: 54px; height: 64px; border: 1px solid var(--line); border-radius: 7px; background: #f3f7f3; object-fit: cover; }
.photo-fallback { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { padding: 10px 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
td { padding: 13px 8px; border-top: 1px solid #edf1ed; }
footer { padding: 22px 0 4px; text-align: center; }
.site-footer { display: flex; justify-content: space-between; gap: 12px; padding: 22px 4px 8px; color: var(--muted); font-size: 12px; }
.registration-confirmation { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; margin: 0 0 20px; padding: 15px 17px; border: 1px solid #b8e3c7; border-radius: 13px; background: linear-gradient(110deg, #effaf3, #f5fcf7); color: #145a37; }
.confirmation-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #218951; color: white; font-size: 21px; font-weight: 800; }
.confirmation-copy { display: grid; gap: 3px; min-width: 0; line-height: 1.4; }
.confirmation-copy strong { font-size: 15px; }
.confirmation-copy span { color: #315e45; font-size: 13px; }
.confirmation-copy small { color: #5e7967; font-size: 12px; }
.confirmation-ok { min-width: 72px; min-height: 42px; margin: 0; padding-inline: 15px; }
.event-edit-link { display: block; width: fit-content; margin-top: 4px; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; }
.event-edit-link:hover { text-decoration: underline; }
.edit-event-form { margin-top: 18px; }
@media (max-width: 760px) {
  .page { width: min(100% - 24px, 620px); margin: 20px auto; }
  .hero { padding: 21px 22px 26px; }
  .school-brand { gap: 10px; }
  .school-logo { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
  .school-brand-copy small { font-size: 11px; }
  .hero-copy { padding-top: 22px; }
  .card { padding: 22px 20px; }
  .auth-card { padding: 22px 20px; }
  .lookup-form { grid-template-columns: 1fr; }
  .lookup-form button { width: 100%; }
  .house-form { grid-template-columns: 1fr; }
  .house-form button { width: 100%; }
  .section-title { align-items: flex-start; }
  .row, .row.three { grid-template-columns: 1fr; }
  .student-summary { grid-template-columns: 1fr 1fr; }
  .table-wrap { overflow: visible; }
  .list-card .table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
  .list-card table { display: table; width: 100%; min-width: 560px; table-layout: auto; }
  .list-card thead { display: table-header-group; }
  .list-card tbody { display: table-row-group; }
  .list-card tr { display: table-row; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .list-card td { display: table-cell; width: auto; padding: 8px 7px; border-top: 1px solid #edf1ed; white-space: nowrap; overflow-wrap: normal; }
  .list-card td::before { display: none; }
  .list-card td:last-child { display: table-cell; padding: 8px 7px; border-top: 1px solid #edf1ed; }
  .list-card td:last-child::before { display: none; }
  .list-card th { padding: 8px 7px; white-space: nowrap; }
  .list-card .student-photo { width: 38px; height: 46px; }
  .list-card .category-group h4 { position: sticky; left: 0; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tbody tr { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  td { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 10px; padding: 7px 0; border-top: 0; white-space: normal; overflow-wrap: anywhere; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  td:last-child { display: block; padding-top: 10px; border-top: 1px solid var(--line); }
  td:last-child::before { display: block; margin-bottom: 8px; }
  .row-actions { gap: 8px; }
  .student-photo { width: 48px; height: 58px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .hero-copy h1 { max-width: 18ch; font-size: clamp(27px, 7.5vw, 36px); line-height: 1.12; }
  .hero-copy { padding-top: 17px; }
  .hero { padding: 18px 18px 21px; border-radius: 15px; }
  .school-brand { align-items: flex-start; padding-bottom: 13px; }
  .school-brand-copy strong { max-width: 19ch; line-height: 1.25; }
  .header-actions { flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: 6px; }
  .header-house, .header-logout { min-height: 34px; justify-content: center; padding: 5px 9px; font-size: 12px; }
  .card { margin-top: 14px; }
  .registration-confirmation { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 13px; }
  .confirmation-icon { width: 34px; height: 34px; }
  .confirmation-ok { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 400px) {
  .page { width: calc(100% - 20px); margin: 12px auto; }
  .hero { padding: 18px 16px 22px; }
  .hero-admin-link { padding: 6px 8px; font-size: 12px; }
  .card { padding: 18px 14px; }
  .student-summary { grid-template-columns: 1fr; }
  .section-title { flex-direction: column; }
  td { grid-template-columns: minmax(78px, 32%) 1fr; }
  .list-card table { min-width: 520px; }
  .school-brand-copy strong { font-size: 13px; line-height: 1.2; }
  .school-brand-copy small { font-size: 10px; }
  .school-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .header-actions { gap: 5px; }
  .header-house, .header-logout { min-height: 32px; padding: 4px 7px; font-size: 11px; }
  .hero-copy h1 { font-size: 27px; }
}

/* House incharge OTP screen */
.login-body { min-height: 100vh; background: #f8fbff; color: #273550; font-family: 'DM Sans', sans-serif; }
.login-page { width: 100%; min-height: 100vh; display: grid; place-items: center; padding: 16px 12px 10px; }
.login-device { position: relative; width: min(100%, 430px); min-height: min(760px, calc(100svh - 34px)); display: flex; flex-direction: column; overflow: hidden; border: 6px solid #4b3ee8; border-radius: 42px; background: #eaf5ff; box-shadow: 0 18px 45px #344fc52b, inset 0 0 0 2px #1c2442; }
.login-statusbar { height: 31px; flex: 0 0 31px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; background: #36a2f0; color: white; font-size: 12px; font-weight: 700; }
.login-screen { position: relative; flex: 1; overflow: hidden; background: linear-gradient(180deg, #fbfdff 0%, #eef7ff 58%, #e3f2ff 100%); }
.login-orb { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.login-orb-blue { top: -116px; left: -84px; width: 245px; height: 245px; background: #5cb7f4; }
.login-orb-purple { top: -76px; right: -128px; width: 285px; height: 285px; background: #7773f5; }
.login-content { position: relative; z-index: 1; width: min(330px, calc(100% - 42px)); margin: 0 auto; padding: 154px 0 28px; text-align: center; }
.login-avatar { width: 84px; height: 84px; margin: 0 auto 16px; color: #39a7f1; }
.login-avatar svg { display: block; width: 100%; height: 100%; }
.login-school { margin: 0 0 5px; color: #3975a8; font-size: 12px; font-weight: 700; letter-spacing: .025em; }
.login-content h1 { margin: 0; color: #242f56; font-size: clamp(22px, 5vw, 27px); letter-spacing: -.035em; }
.login-description { min-height: 38px; margin: 8px 0 18px; color: #6384a5; font-size: 13px; line-height: 1.45; }
.login-form { gap: 13px; }
.login-form label { display: block; }
.login-form input { min-height: 46px; border: 0; border-radius: 11px; background: #7773f5; color: white; text-align: center; box-shadow: 0 3px 8px #7773f533; }
.login-form input::placeholder { color: #f2f2ff; opacity: 1; }
.login-form input:focus { outline: 3px solid #43aaf15c; border: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.remember-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: #549bd1; font-size: 12px; }
.check-mark { width: 15px; height: 15px; display: inline-grid; place-items: center; border: 1px solid #3ca5ed; border-radius: 3px; background: #3ca5ed; color: white; font-size: 11px; font-weight: 800; }
.login-submit { width: min(70%, 190px); min-height: 46px; justify-self: center; margin-top: 13px; border-radius: 11px; background: #38a4ee; box-shadow: 0 5px 12px #38a4ee3b; }
.login-submit:hover { background: #218dd7; }
.login-link { display: inline-block; padding: 7px; border: 0; background: transparent; color: #479bd4; font-size: 12px; text-decoration: none; }
.login-link:hover { background: transparent; text-decoration: underline; }
.help-link { margin-top: 7px; }
.login-resend { margin-top: 8px; text-align: center; }
.login-message { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.4; }
.login-message.success { background: #e2f7ec; color: #16613f; }
.login-message.error { background: #fff0ed; color: #94362e; text-align: left; }
.login-message ul { margin: 0; padding-left: 17px; }
.login-bottom-band { height: 28px; flex: 0 0 28px; background: #36a2f0; }
.login-site-footer { padding: 11px 6px 0; color: #7187a2; font-size: 11px; text-align: center; }
@media (max-width: 480px) {
  .login-page { padding: 8px; }
  .login-device { width: 100%; min-height: calc(100svh - 32px); border-radius: 35px; }
  .login-content { padding-top: clamp(132px, 24svh, 166px); }
  .login-orb-blue { top: -126px; left: -104px; }
  .login-orb-purple { top: -92px; right: -150px; }
}

/* Refined house incharge sign-in styling */
.login-body { background: radial-gradient(ellipse at 12% 12%, #d9efff 0, transparent 36%), radial-gradient(ellipse at 92% 82%, #e9e3ff 0, transparent 34%), #f7f9ff; }
.login-page { padding: 22px 14px 12px; }
.login-device { border: 5px solid #4c43df; border-radius: 43px; background: #101a35; box-shadow: 0 28px 70px #3648a83b, 0 9px 22px #1f2c5940, inset 0 0 0 2px #182447; }
.login-statusbar { height: 34px; flex-basis: 34px; padding-inline: 19px; background: linear-gradient(100deg, #2999ec, #4c7bf7); letter-spacing: .015em; }
.login-screen { background: radial-gradient(ellipse at 50% 5%, #fff 0, #f8fbff 38%, #e8f4ff 100%); }
.login-orb-blue { top: -135px; left: -96px; width: 260px; height: 260px; background: linear-gradient(145deg, #4fc4f5, #60aaf4); box-shadow: 0 22px 55px #50aef33b; }
.login-orb-purple { top: -91px; right: -142px; width: 300px; height: 300px; background: linear-gradient(145deg, #8678ff, #665ee9); box-shadow: 0 22px 55px #7168ed3d; }
.login-content { padding-top: 158px; }
.login-avatar { display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 18px; padding: 6px; border: 1px solid #ffffff; border-radius: 28px; background: linear-gradient(145deg, #fff, #eaf5ff); box-shadow: 0 12px 28px #328bd52b; }
.login-avatar svg { width: 72px; height: 72px; }
.login-school { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; padding: 6px 11px; border: 1px solid #dceafd; border-radius: 999px; background: #f3f8ff; color: #4274a8; font-size: 11px; letter-spacing: .01em; }
.login-school::before { width: 7px; height: 7px; border-radius: 50%; background: #36a5ee; content: ""; box-shadow: 0 0 0 3px #36a5ee20; }
.login-content h1 { color: #1c2d52; font-size: clamp(24px, 5vw, 28px); letter-spacing: -.045em; }
.login-description { margin: 7px 0 21px; color: #7487a5; font-size: 13px; }
.login-form { gap: 14px; }
.login-form input { min-height: 49px; padding: 12px 15px; border: 1px solid #dce5f8; border-radius: 13px; background: linear-gradient(180deg, #fff, #f7f8ff); color: #263859; text-align: left; box-shadow: 0 4px 12px #303d6810; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.login-form input::placeholder { color: #8794b1; }
.login-form input:focus { outline: 0; border-color: #7974ef; box-shadow: 0 0 0 4px #7974ef20, 0 6px 15px #303d6812; }
.login-form select { min-height: 49px; padding: 12px 15px; border: 1px solid #dce5f8; border-radius: 13px; background: linear-gradient(180deg, #fff, #f7f8ff); color: #263859; box-shadow: 0 4px 12px #303d6810; }
.login-form select:focus { outline: 0; border-color: #7974ef; box-shadow: 0 0 0 4px #7974ef20, 0 6px 15px #303d6812; }
.login-form option { background: #fff; color: #263859; }
.remember-note { justify-content: flex-start; padding: 1px 3px; color: #7588aa; font-size: 12px; }
.check-mark { border-color: #8078f1; background: linear-gradient(135deg, #8078f1, #4da4ef); box-shadow: 0 3px 8px #6d79e931; }
.login-submit { width: 72%; min-height: 48px; margin-top: 7px; border-radius: 13px; background: linear-gradient(100deg, #38aaf0, #5977f4); box-shadow: 0 9px 19px #477ff04a; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.login-submit:hover { background: linear-gradient(100deg, #2699e2, #4c67e9); transform: translateY(-2px); box-shadow: 0 12px 24px #477ff05c; }
.login-submit:active { transform: translateY(0); }
.login-link { color: #558bc5; font-weight: 600; }
.login-message { border: 1px solid transparent; box-shadow: 0 4px 12px #303d6810; }
.login-message.success { border-color: #c7ead7; background: #eefaf3; color: #176344; }
.login-message.error { border-color: #f2d2ce; background: #fff5f3; color: #913c34; }
.login-bottom-band { height: 31px; flex-basis: 31px; background: linear-gradient(100deg, #339ff0, #527cf4); }
.login-site-footer { color: #7788a5; font-size: 11px; letter-spacing: .015em; }
@media (max-width: 480px) {
  .login-page { padding: 8px; }
  .login-device { min-height: calc(100svh - 28px); border-radius: 37px; }
  .login-content { padding-top: clamp(106px, 18svh, 142px); padding-bottom: 20px; }
  .login-orb-blue { top: -138px; left: -110px; }
  .login-orb-purple { top: -102px; right: -158px; }
  .teacher-register-content { padding-top: clamp(98px, 17svh, 128px); }
}
@media (max-width: 480px) and (max-height: 740px) {
  .login-page { align-items: start; padding-top: 8px; }
  .login-device { min-height: calc(100svh - 16px); overflow: visible; }
  .login-screen { overflow: visible; }
  .login-content { padding-top: 88px; }
  .teacher-register-content { padding-top: 78px; }
  .login-orb-blue { top: -153px; width: 225px; height: 225px; }
  .login-orb-purple { top: -118px; width: 260px; height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-form input, .login-submit { transition: none; }
}
