/* UMS Login — light glassmorphism, mobile-friendly */

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

:root {
  --bg-0: #e8eef7;
  --bg-1: #f4f7fc;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --danger: #dc2626;
  --glass: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tap: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  min-height: -webkit-fill-available;
  max-width: 100vw;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* —— Site navigation —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0
    max(12px, env(safe-area-inset-left));
}

.site-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-logo-wrap {
  flex-shrink: 0;
  color: var(--accent);
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.nav-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.nav-brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 200px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .nav-brand-sub {
    display: none;
  }
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(145deg, var(--bg-1) 0%, #dbe7f7 45%, #e5edf8 100%);
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.85;
  animation: float 18s ease-in-out infinite;
}

.orb-a {
  width: min(420px, 90vw);
  height: min(420px, 90vw);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle at 30% 30%, #93c5fd, #bfdbfe 50%, transparent 70%);
}

.orb-b {
  width: min(360px, 80vw);
  height: min(360px, 80vw);
  bottom: -10%;
  right: -6%;
  background: radial-gradient(circle at 60% 40%, #c4b5fd, #ddd6fe 45%, transparent 72%);
  animation-delay: -6s;
}

.orb-c {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  top: 42%;
  left: 35%;
  background: radial-gradient(circle at 50% 50%, #a5f3fc, transparent 65%);
  opacity: 0.55;
  animation-delay: -12s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(2%, -3%) scale(1.03);
  }
  66% {
    transform: translate(-2%, 2%) scale(0.98);
  }
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 70%);
  opacity: 0.5;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right)) max(24px, var(--safe-bottom))
    max(16px, var(--safe-left));
  gap: clamp(1.25rem, 4vw, 2rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 420px;
  width: 100%;
  animation: rise 0.7s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.glass.card {
  width: 100%;
  max-width: 420px;
  padding: clamp(1.5rem, 5vw, 2rem);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: rise 0.75s ease-out 0.08s both;
}

.card-head {
  margin-bottom: 1.5rem;
}

.card-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: var(--tap);
  padding: 0 1rem;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder {
  color: #94a3b8;
}

input:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: rgba(255, 255, 255, 0.75);
}

.linkish {
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

.linkish:hover {
  text-decoration: underline;
}

.linkish:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feedback {
  min-height: 1.25rem;
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--danger);
}

.feedback:empty {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.42);
}

.btn.primary:focus-visible {
  outline: 2px solid #1e40af;
  outline-offset: 3px;
}

.btn.ghost {
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.75);
}

.btn-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.loading .btn-label {
  opacity: 0.65;
}

.btn.loading .btn-spinner {
  display: block;
  position: absolute;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.panel.hidden {
  display: none !important;
}

.hint {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.foot {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  animation: rise 0.85s ease-out 0.15s both;
}

.foot .dot {
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .btn-spinner {
    animation: none;
  }

  .brand,
  .glass.card,
  .foot {
    animation: none;
  }
}
