:root {
  --bg: #070b12;
  --bg-soft: #0c1422;
  --panel: #0f1828;
  --panel-strong: #121e31;
  --ink: #e6f0ff;
  --ink-soft: #a6bdd6;
  --accent: #2cc3ff;
  --accent-strong: #1d7bff;
  --success: #27e59d;
  --stroke: rgba(120, 170, 220, 0.18);
  --glow: rgba(44, 195, 255, 0.3);
}

html, body {
  height: 100%;
}

body {
  background:
    radial-gradient(60rem 40rem at 10% -20%, rgba(39, 229, 157, 0.12), transparent 55%),
    radial-gradient(50rem 35rem at 95% 10%, rgba(44, 195, 255, 0.2), transparent 55%),
    linear-gradient(160deg, #060a10 0%, #0a1322 65%, #0c1626 100%);
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(transparent 96%, rgba(39, 229, 157, 0.05) 100%),
    linear-gradient(90deg, transparent 96%, rgba(44, 195, 255, 0.05) 100%);
  background-size: 36px 36px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

main {
  z-index: 1;
  position: relative;
}

.logo-container {
  text-align: center;
  margin-top: 28px;
}

.logo-container img {
  height: 56px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.35));
}

.wrapper {
  background: linear-gradient(180deg, rgba(15, 24, 40, 0.96), rgba(12, 20, 34, 0.98));
  border-radius: 18px;
  padding: 2.6rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--stroke);
  position: relative;
  z-index: 1;
}

.wrapper::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  border: 1px solid rgba(44, 195, 255, 0.18);
  pointer-events: none;
}

.wrapper h2 {
  margin-bottom: 1.6rem;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  text-align: center;
}

.input-field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, rgba(7, 12, 20, 0.95), rgba(12, 20, 34, 0.9));
  border: 1px solid rgba(44, 195, 255, 0.22);
  border-radius: 12px;
  padding: 0.2rem 0.9rem;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.input-field:focus-within {
  border-color: rgba(44, 195, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(44, 195, 255, 0.18), 0 12px 26px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.input-field i {
  margin-right: 0.75rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.input-field input {
  border: none;
  outline: none;
  padding: 0.8rem 0;
  width: 100%;
  font-size: 0.95rem;
  background: transparent;
  color: var(--ink);
}

.input-field input::placeholder {
  color: rgba(166, 189, 214, 0.6);
}

.input-field input:-webkit-autofill,
.input-field input:-webkit-autofill:hover,
.input-field input:-webkit-autofill:focus,
.input-field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 30px rgba(7, 12, 20, 0.98) inset;
  box-shadow: 0 0 0 30px rgba(7, 12, 20, 0.98) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  color: #02101c;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  width: 100%;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(44, 195, 255, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(44, 195, 255, 0.35);
}

.btn-secondary {
  background: rgba(14, 24, 38, 0.9);
  border: 1px solid rgba(44, 195, 255, 0.2);
  color: var(--ink);
  box-shadow: none;
}

.alert {
  font-size: 0.95rem;
  margin-top: 1rem;
}

.alert-danger {
  background: rgba(255, 87, 121, 0.12);
  border: 1px solid rgba(255, 87, 121, 0.35);
  color: #ffb3c4;
}

.text-muted {
  color: rgba(230, 240, 255, 0.7) !important;
}

.alt-link a {
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}

.alt-link a:hover {
  text-decoration: underline;
}

.dashboard-topbar {
  background: rgba(6, 12, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 14px 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: 64px;
  border-bottom: 1px solid rgba(44, 195, 255, 0.2);
  backdrop-filter: blur(12px);
}

.portal-title {
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  margin-left: 12px;
  max-width: 60vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.logout-link {
  color: #e6f0ff;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  background: rgba(44, 195, 255, 0.12);
  border: 1px solid rgba(44, 195, 255, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.logout-link:hover {
  background: rgba(44, 195, 255, 0.2);
}

.dashboard-wrapper {
  max-width: 960px;
  width: 100%;
  background: linear-gradient(180deg, rgba(15, 24, 40, 0.96), rgba(12, 20, 34, 0.98));
  padding: 2.2rem;
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
  color: var(--ink);
  margin-top: 80px;
  border: 1px solid rgba(44, 195, 255, 0.15);
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-row-link {
  text-decoration: none;
}

.app-row-simple {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1.1rem 1.3rem;
  background: rgba(9, 15, 26, 0.9);
  color: var(--ink);
  border-radius: 12px;
  border: 1px solid rgba(44, 195, 255, 0.16);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}

.app-row-simple:hover {
  background: rgba(12, 20, 34, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(44, 195, 255, 0.2);
}

.app-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

.app-row-simple img.app-icon {
  display: block;
}

.dashboard-center {
  margin-top: 70px;
  display: flex;
  justify-content: center;
  align-items: start;
  min-height: calc(100vh - 70px);
}

footer {
  background: rgba(6, 12, 20, 0.9);
  color: #c7daef;
  text-align: center;
  padding: 12px 0;
  font-size: 0.9rem;
  margin-top: 3rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

@media (max-width: 480px) {
  .dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-title {
    font-size: 0.95rem;
    max-width: 100%;
    white-space: normal;
  }

  .logout-link {
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
  }

  .logo-container img {
    height: 48px;
  }
}
