:root {
  --bg1: #071a2f;
  --bg2: #1b1464;
  --card: rgba(8, 18, 42, 0.78);
  --card-border: rgba(111, 241, 255, 0.28);
  --cyan: #5ff7ff;
  --turquoise: #22d3c5;
  --violet: #6b5cff;
  --text: #ecfaff;
  --muted: #abd3df;
  --danger: #ff7c92;
  --success: #62ffb1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.card {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
}

.register-card { max-width: 480px; }
.dashboard-card { max-width: 520px; text-align: center; padding-top: 36px; }
.success-card { text-align: center; }

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.logo-main {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255,255,255,0.05);
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.logo-fallback, .inner-fallback {
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--cyan);
  background: rgba(255,255,255,0.06);
}
.logo-fallback {
  width: 120px; height: 120px; border-radius: 22px;
}
.inner-fallback {
  width: 70px; height: 70px; border-radius: 50%;
}

h1 {
  margin: 0 0 10px;
  font-size: 1.7rem;
  text-align: center;
}

.subtext {
  text-align: center;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-size: 0.95rem;
  color: #dffcff;
}

input {
  width: 100%;
  border: 1px solid rgba(95, 247, 255, 0.25);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 14px;
  padding: 14px;
  outline: none;
  font-size: 0.98rem;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(95, 247, 255, 0.12);
}

.password-wrap {
  position: relative;
}

.password-wrap input { padding-right: 70px; }

.toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--turquoise), var(--violet));
  color: #fff;
  cursor: pointer;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
  margin-top: 6px;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.primary {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  color: #041021;
}

.secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(95,247,255,0.22);
}

.small-btn {
  width: auto;
  padding: 10px 14px;
  text-decoration: none;
}

.loader-box, .circle-loader-box {
  margin-top: 18px;
  text-align: center;
}
.hidden { display: none; }

.loader-title {
  margin: 10px 0 14px;
  font-weight: bold;
  color: var(--cyan);
}

.progress-bar {
  width: 100%;
  height: 16px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(95,247,255,0.18);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--turquoise), var(--cyan), var(--violet));
  transition: width 0.1s linear;
}

.progress-text {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: bold;
}

.progress-text.big { font-size: 1.2rem; }

.circle-loader {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  position: relative;
}

.circle-loader svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg, .circle-progress {
  fill: none;
  stroke-width: 9;
}

.circle-bg {
  stroke: rgba(255,255,255,0.12);
}

.circle-progress {
  stroke: var(--cyan);
  stroke-linecap: round;
  stroke-dasharray: 326.72;
  stroke-dashoffset: 326.72;
  transition: stroke-dashoffset 0.1s linear;
}

.circle-inner-image {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fading-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  animation: fadePulse 1.7s ease-in-out infinite;
  border: 2px solid rgba(95,247,255,0.2);
}

@keyframes fadePulse {
  0% { opacity: 0.25; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.25; transform: scale(0.92); }
}

.alert {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 14px;
  text-align: center;
}
.alert.error {
  background: rgba(255, 124, 146, 0.14);
  border: 1px solid rgba(255, 124, 146, 0.3);
  color: #ffd3db;
}

.success-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(98,255,177,0.13);
  border: 1px solid rgba(98,255,177,0.35);
  color: var(--success);
  font-size: 2rem;
  margin: 0 auto 14px;
}

.topbar {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-mini {
  font-weight: 700;
  color: var(--cyan);
}

.logout-btn {
  background: linear-gradient(90deg, var(--turquoise), var(--violet));
  color: white;
}

.user-id {
  color: var(--muted);
  margin-bottom: 20px;
}

.status-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(95,247,255,0.2);
  border-radius: 18px;
  padding: 18px;
}

.status-pill {
  display: inline-block;
  margin-bottom: 10px;
  background: rgba(95,247,255,0.12);
  color: var(--cyan);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: bold;
}

@media (max-width: 480px) {
  .card {
    padding: 20px 15px;
    border-radius: 20px;
  }

  h1 { font-size: 1.45rem; }
  .logo-main, .logo-fallback { width: 100px; height: 100px; }
  .circle-loader { width: 160px; height: 160px; }
}
