:root {
  color-scheme: light;
  --ink: #14233a;
  --muted: #6f7d90;
  --green: #16a873;
  --cyan: #159ab6;
  font-family: "Manrope", Calibri, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(31, 190, 133, 0.08), transparent 27%),
    radial-gradient(circle at 92% 88%, rgba(22, 158, 191, 0.08), transparent 29%),
    #fff;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(17, 91, 77, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 91, 77, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 82%);
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

main {
  display: grid;
  width: min(1240px, calc(100% - 64px));
  min-height: 100dvh;
  align-content: center;
  margin: 0 auto;
  padding: 44px 0 30px;
}

.welcome {
  margin-bottom: 28px;
  text-align: center;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 86px;
  height: 86px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 26px;
  background: #fff;
  box-shadow:
    0 18px 42px rgba(20, 139, 117, 0.18),
    0 0 0 1px rgba(18, 129, 109, 0.08);
}

.brand-mark::after {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  content: "";
  border: 4px solid #fff;
  border-radius: 50%;
  background: #1dbd7d;
  box-shadow: 0 5px 12px rgba(20, 156, 105, 0.3);
}

.brand-mark img {
  width: 76px;
  height: 76px;
  border-radius: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  padding: 8px 13px;
  border: 1px solid #dcefe8;
  border-radius: 999px;
  color: #12805c;
  background: #f5fcf9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.eyebrow i,
.secure-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1dbd7d;
  box-shadow: 0 0 0 5px rgba(29, 189, 125, 0.12);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h1 span {
  color: transparent;
  background: linear-gradient(110deg, #12a56e, #1798b6);
  background-clip: text;
  -webkit-background-clip: text;
}

.welcome > p {
  max-width: 720px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.selector {
  position: relative;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(208, 221, 218, 0.92);
  border-radius: 29px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 28px 80px rgba(23, 54, 73, 0.09),
    0 3px 12px rgba(23, 54, 73, 0.035);
}

.selector::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 36%;
  height: 3px;
  content: "";
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #27ba87, #25a8c1, transparent);
}

.selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
  padding: 0 3px;
}

.selector-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.selector-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.secure-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: #4f6c63;
  font-size: 13px;
  font-weight: 700;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.portal-card {
  --accent: #14a673;
  --soft: #edf9f4;
  position: relative;
  display: block;
  min-height: 252px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid #e5ece9;
  border-radius: 23px;
  color: var(--ink);
  background: linear-gradient(145deg, #fff 50%, var(--soft));
  text-decoration: none;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.portal-card::after {
  position: absolute;
  right: -55px;
  bottom: -62px;
  width: 150px;
  height: 150px;
  content: "";
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transition: transform 0.25s ease;
}

.portal-card:hover,
.portal-card:focus-visible {
  z-index: 2;
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 34%, #e4ece9);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translateY(-5px);
}

.portal-card:focus-visible {
  box-shadow:
    0 18px 40px color-mix(in srgb, var(--accent) 14%, transparent),
    0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.portal-card:hover::after {
  transform: scale(1.18);
}

.portal-card.siswa {
  --accent: #1489ca;
  --soft: #eff8fd;
}

.portal-card.admin {
  --accent: #765ad8;
  --soft: #f5f2ff;
}

.portal-card.yayasan {
  --accent: #e6922b;
  --soft: #fff8ed;
}

.card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.portal-icon {
  position: relative;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.98), transparent 42%),
    color-mix(in srgb, var(--accent) 8%, #fff);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.95),
    0 15px 28px color-mix(in srgb, var(--accent) 16%, transparent);
}

.portal-art {
  position: absolute;
  inset: -8px;
  background-image: url("/portal-icons-3d-v151.png");
  background-repeat: no-repeat;
  background-size: 200% 200%;
  filter: drop-shadow(0 9px 8px rgba(24, 47, 40, 0.16));
}

.portal-art.guru {
  background-position: 100% 0;
}

.portal-art.siswa {
  background-position: 0 0;
}

.portal-art.admin {
  background-position: 0 100%;
}

.portal-art.yayasan {
  background-position: 100% 100%;
}

.number {
  color: color-mix(in srgb, var(--accent) 78%, #8793a2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.portal-copy {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 20px;
}

.portal-copy small {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.portal-copy h2 {
  margin: 7px 0 7px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.portal-copy p {
  min-height: 42px;
  margin: 0;
  color: #758195;
  font-size: 13px;
  line-height: 1.55;
}

.enter {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.enter b {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.portal-card:hover .enter b {
  transform: translateX(3px);
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  color: #8a95a4;
  font-size: 12px;
}

footer i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b8c1ca;
}

@media (max-width: 1050px) {
  main {
    width: min(900px, calc(100% - 44px));
    padding: 36px 0 28px;
  }

  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-card {
    min-height: 230px;
  }
}

@media (max-width: 650px) {
  main {
    width: min(520px, calc(100% - 28px));
    align-content: start;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  }

  .welcome {
    margin-bottom: 22px;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 22px;
  }

  .brand-mark img {
    width: 64px;
    height: 64px;
    border-radius: 19px;
  }

  .brand-mark::after {
    width: 17px;
    height: 17px;
    border-width: 3px;
  }

  .eyebrow {
    font-size: 10.5px;
  }

  h1 {
    font-size: clamp(29px, 9vw, 38px);
  }

  .welcome > p {
    font-size: 14px;
  }

  .selector {
    padding: 17px;
    border-radius: 23px;
  }

  .selector-head {
    align-items: flex-start;
  }

  .selector-head h2 {
    font-size: 19px;
  }

  .secure-status {
    display: none;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-card {
    min-height: 0;
    padding: 20px;
  }

  .portal-copy p {
    min-height: 0;
    font-size: 13.5px;
  }

  footer {
    align-items: center;
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  footer i {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
