/* SchoolDesk modern login — shared by admin + student/parent */
:root {
  --sd-ink: #111111;
  --sd-ink-soft: #1a1a1a;
  --sd-sea: #c48400;
  --sd-sea-bright: #f5a623;
  --sd-sand: #f7f4ee;
  --sd-sand-deep: #ebe4d6;
  --sd-amber: #f5a623;
  --sd-amber-hot: #ffb000;
  --sd-line: rgba(17, 17, 17, 0.12);
  --sd-muted: rgba(17, 17, 17, 0.58);
  --sd-panel: rgba(255, 252, 247, 0.94);
  --sd-radius: 18px;
  --sd-shadow: 0 24px 60px rgba(17, 17, 17, 0.16);
  --sd-font: "Outfit", system-ui, sans-serif;
  --sd-display: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sd-font);
  color: var(--sd-ink);
  background: var(--sd-sand);
  -webkit-font-smoothing: antialiased;
}

body.sd-login-body {
  min-height: 100vh;
  overflow-x: hidden;
}

.sd-login {
  display: grid;
  grid-template-columns: minmax(340px, 460px) 1fr;
  min-height: 100vh;
  position: relative;
}

.sd-login__mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 10% 20%, rgba(245, 166, 35, 0.28), transparent 60%),
    radial-gradient(ellipse 45% 35% at 90% 80%, rgba(255, 176, 0, 0.14), transparent 55%),
    linear-gradient(160deg, #faf7f0 0%, #f3ead8 45%, #f7f4ee 100%);
  animation: sd-mesh-drift 18s ease-in-out infinite alternate;
}

@keyframes sd-mesh-drift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.06) translate(-1.5%, 1%); }
}

.sd-login__panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--sd-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--sd-shadow);
  animation: sd-panel-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sd-panel-in {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.sd-login__brand {
  margin-bottom: 1.75rem;
}

.sd-login__logo {
  display: block;
  max-width: 200px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}

.sd-login__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sd-sea);
  margin-bottom: 0.55rem;
}

.sd-login__title {
  font-family: var(--sd-display);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
  color: var(--sd-ink);
}

.sd-login__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--sd-muted);
  line-height: 1.45;
  max-width: 28ch;
}

.sd-login__form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 0.25rem;
}

.sd-field {
  position: relative;
}

.sd-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sd-muted);
  margin-bottom: 0.4rem;
}

.sd-field input,
.sd-field select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--sd-line);
  background: #fff;
  color: var(--sd-ink);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.3;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sd-field input:focus,
.sd-field select:focus {
  outline: none;
  border-color: var(--sd-sea-bright);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.22);
}

.sd-field--password input {
  padding-right: 3rem;
}

.sd-field__toggle {
  position: absolute;
  right: 0.65rem;
  bottom: 0.55rem;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  background: transparent;
  color: var(--sd-muted);
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sd-field__toggle:hover {
  color: var(--sd-ink);
  background: rgba(12, 31, 36, 0.06);
}

.sd-field .text-danger,
.sd-login .text-danger {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #b91c1c !important;
}

.sd-alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  animation: sd-alert-in 0.45s ease both;
}

@keyframes sd-alert-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sd-alert--danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.sd-alert--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.sd-captcha {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.sd-captcha__image {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.4rem 0.6rem;
  background: #fff;
  border: 1.5px solid var(--sd-line);
  border-radius: 12px;
}

.sd-captcha__image img {
  max-height: 40px;
}

.sd-captcha__refresh {
  border: 0;
  background: var(--sd-ink);
  color: #fff;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.sd-captcha__refresh:hover {
  background: var(--sd-amber);
  transform: rotate(45deg);
}

.sd-btn {
  margin-top: 0.35rem;
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, #1a1a1a 0%, #c48400 55%, #f5a623 100%);
  border-radius: 14px;
  padding: 0.95rem 1.25rem;
  box-shadow: 0 12px 28px rgba(245, 166, 35, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sd-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.sd-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(245, 166, 35, 0.4);
  filter: brightness(1.05);
}

.sd-btn:hover::after {
  transform: translateX(120%);
}

.sd-btn:active {
  transform: translateY(0);
}

.sd-login__meta {
  margin-top: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.sd-login__meta a {
  color: var(--sd-sea);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.sd-login__meta a:hover {
  color: var(--sd-amber-hot);
}

.sd-login__switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.12);
  color: var(--sd-ink-soft) !important;
  font-size: 0.82rem !important;
}

.sd-login__switch:hover {
  background: rgba(245, 166, 35, 0.2);
}

.sd-login__visual {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  background-color: var(--sd-ink);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  animation: sd-visual-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes sd-visual-in {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

.sd-login__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(17, 17, 17, 0.78) 0%, rgba(17, 17, 17, 0.4) 45%, rgba(196, 132, 0, 0.28) 100%),
    linear-gradient(0deg, rgba(17, 17, 17, 0.6) 0%, transparent 40%);
  z-index: 1;
}

.sd-login__visual-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  color: #fff;
}

.sd-login__visual-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.65rem;
}

.sd-login__visual-name {
  font-family: var(--sd-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  max-width: 14ch;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.sd-login__visual-tag {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  opacity: 0.88;
  max-width: 36ch;
}

.sd-notices {
  margin-top: 2rem;
  max-width: 420px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sd-notices__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 0 0 0.85rem;
}

.sd-notice {
  padding: 0.85rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.sd-notice:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.sd-notice h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--sd-display);
}

.sd-notice p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.88;
}

.sd-notice a.more {
  color: #fde68a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sd-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  z-index: 1;
  pointer-events: none;
  animation: sd-orb 12s ease-in-out infinite alternate;
}

.sd-orb--1 {
  width: 280px;
  height: 280px;
  background: var(--sd-amber-hot);
  top: 12%;
  right: 18%;
}

.sd-orb--2 {
  width: 200px;
  height: 200px;
  background: #c48400;
  bottom: 18%;
  right: 8%;
  animation-delay: -4s;
}

@keyframes sd-orb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-30px, 20px) scale(1.12); }
}

@media (max-width: 960px) {
  .sd-login {
    grid-template-columns: 1fr;
  }

  .sd-login__visual {
    min-height: 42vh;
    order: -1;
  }

  .sd-login__visual-inner {
    min-height: 42vh;
    justify-content: flex-end;
    padding-bottom: 1.5rem;
  }

  .sd-login__visual-name {
    max-width: none;
    font-size: clamp(1.75rem, 7vw, 2.4rem);
  }

  .sd-notices {
    display: none;
  }

  .sd-login__panel {
    border-right: 0;
    border-radius: 24px 24px 0 0;
    margin-top: -1.25rem;
    box-shadow: 0 -12px 40px rgba(12, 31, 36, 0.12);
  }

  .sd-orb {
    display: none;
  }
}

@media (max-width: 480px) {
  .sd-login__panel {
    padding: 1.35rem 1.15rem 2rem;
  }

  .sd-captcha {
    grid-template-columns: 1fr;
  }
}
