﻿/* Login mahasiswa â€” selaras landing SKPI */
:root {
  --ink: #07131f;
  --teal: #1f8a7a;
  --teal-bright: #2bb5a0;
  --sand: #e8eef2;
  --mist: rgba(232, 238, 242, 0.78);
  --line: rgba(232, 238, 242, 0.18);
  --panel: rgba(10, 28, 44, 0.72);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", "Segoe UI", sans-serif;
  --pad-x: clamp(1.1rem, 5vw, 3rem);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--sand);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

.bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) scale(1.05);
  object-fit: cover;
  animation: drift 30s ease-in-out infinite alternate;
}

.bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(7, 19, 31, 0.94) 0%, rgba(7, 19, 31, 0.78) 48%, rgba(12, 39, 64, 0.62) 100%),
    linear-gradient(to top, rgba(7, 19, 31, 0.85), transparent 42%);
}

@keyframes drift {
  from { transform: translate(-50%, -50%) scale(1.05); }
  to { transform: translate(-47%, -52%) scale(1.12); }
}

@media (pointer: coarse) and (hover: none) {
  .bg-video { display: none; }
  .bg {
    background: url("../../img/bg-mobile-fallback.jpg") center / cover no-repeat;
  }
  .bg-veil {
    background: linear-gradient(180deg, rgba(7, 19, 31, 0.9), rgba(7, 19, 31, 0.88));
  }
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(1.35rem + var(--safe-t)) var(--pad-x) 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand img {
  /* PNG seal: sudut hitam menyatu dengan UI gelap; jangan crop lingkaran */
  width: 42px;
  height: 42px;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  line-height: 1.1;
  min-width: 0;
  padding-top: 1px;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: 0.04em;
}

.brand-text small {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mist);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-link {
  font-size: 0.82rem;
  color: var(--mist);
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back-link:hover {
  color: var(--teal-bright);
  border-color: rgba(43, 181, 160, 0.45);
}

.stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem var(--pad-x) 1.5rem;
}

.auth {
  width: min(100%, 26.5rem);
  padding: clamp(1.35rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-logo {
  width: 84px;
  height: 84px;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto 0.55rem;
}

.auth-head h1 {
  margin: 0.15rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #f7fafc;
}

.auth-head p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--mist);
}

.alert {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 120, 100, 0.35);
  background: rgba(120, 28, 28, 0.35);
  color: #ffd7d0;
  font-size: 0.85rem;
}

.auth-form {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mist);
}

.field input {
  width: 100%;
  min-height: 3.05rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  color: #f7fafc;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
  color: rgba(232, 238, 242, 0.4);
}

.field input:focus {
  border-color: rgba(43, 181, 160, 0.65);
  background: rgba(255, 255, 255, 0.08);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 4.5rem;
}

.toggle-pass {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  min-height: 2.35rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.toggle-pass:hover {
  color: var(--teal-bright);
}

.btn-submit {
  margin-top: 0.35rem;
  min-height: 3.15rem;
  border: 0;
  border-radius: 0.4rem;
  background: var(--teal);
  color: #f4fffc;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-submit:hover {
  background: var(--teal-bright);
  color: #04201c;
  transform: translateY(-1px);
}

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

.auth-note {
  margin: 1.15rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--mist);
}

.auth-note a {
  color: var(--teal-bright);
  border-bottom: 1px solid rgba(43, 181, 160, 0.35);
}

.auth-note a:hover {
  border-color: var(--teal-bright);
}

.foot {
  position: relative;
  z-index: 2;
  padding: 0.85rem var(--pad-x) calc(1.1rem + var(--safe-b));
  text-align: center;
}

.foot p {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(232, 238, 242, 0.5);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s);
}

body.is-ready .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .bg-video { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn-submit:hover { transform: none; }
}

@media (max-width: 480px) {
  .auth {
    padding: 1.2rem 1rem;
    border-radius: 0.5rem;
  }

  .auth-logo {
    width: 64px;
    height: 64px;
  }

  .brand-text small {
    max-width: 9.5rem;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .stage {
    align-items: flex-start;
    padding-top: 0.5rem;
  }

  .auth-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 0.45rem;
  }

  .auth-head {
    margin-bottom: 0.85rem;
  }

  .auth-head p {
    display: none;
  }
}

/* Auth error panel (in-card) */
.auth-error {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin: 0 0 1.15rem;
  padding: 0.95rem 1rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 130, 110, 0.35);
  background:
    linear-gradient(135deg, rgba(140, 35, 30, 0.35), rgba(20, 28, 40, 0.55));
  text-align: left;
  animation: authErrorIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-error[hidden] {
  display: none !important;
}

@keyframes authErrorIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-error-icon {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 100, 85, 0.18);
  border: 1px solid rgba(255, 140, 120, 0.45);
  color: #ffb0a0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.auth-error-body {
  min-width: 0;
  flex: 1;
}

.auth-error-body strong {
  display: block;
  margin: 0.1rem 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: #ffe8e2;
}

.auth-error-body p {
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: rgba(255, 230, 224, 0.88);
}

.auth-error-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-error-body li {
  position: relative;
  padding-left: 0.9rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: rgba(232, 238, 242, 0.72);
}

.auth-error-body li + li {
  margin-top: 0.28rem;
}

.auth-error-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: #ff8f7a;
}

@media (prefers-reduced-motion: reduce) {
  .auth-error {
    animation: none;
  }
}