* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #000;
  color: #e5e5e5;
}

.login-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

/* From Uiverse.io by pharmacist-sabot */
/* --- Root Variables for the component --- */
.glitch-form-wrapper {
  --bg-color: rgba(3, 15, 6, 0.94);
  --primary-color: #00ff41;
  --secondary-color: #7dffb1;
  --text-color: #e8ffef;
  --font-family: "Fira Code", Consolas, "Courier New", Courier, monospace;
  --glitch-anim-duration: 0.5s;
}

.glitch-form-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-family);
  background-color: transparent;
}

/* --- Card Structure --- */
.glitch-card {
  background-color: var(--bg-color);
  width: 100%;
  max-width: 380px;
  border: 1px solid rgba(0, 255, 65, 0.28);
  box-shadow:
    0 0 28px rgba(0, 255, 65, 0.12),
    inset 0 0 18px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  margin: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.42);
  padding: 0.5em 1em;
  border-bottom: 1px solid rgba(0, 255, 65, 0.22);
}

.card-title {
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.card-title svg {
  width: 1.2em;
  height: 1.2em;
  stroke: var(--primary-color);
}

.card-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(0, 255, 65, 0.3);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.18);
  margin-left: 5px;
}

.card-body {
  padding: 1.5rem;
}

/* --- Form Elements --- */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-label {
  position: absolute;
  top: 0.75em;
  left: 0;
  font-size: 1rem;
  color: var(--primary-color);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  pointer-events: none;
  transition: all 0.3s ease;
}

.form-group input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(0, 255, 65, 0.3);
  padding: 0.75em 0;
  font-size: 1rem;
  color: var(--text-color);
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  border-color: var(--primary-color);
}

.form-group input:focus + .form-label,
.form-group input:not(:placeholder-shown) + .form-label {
  top: -1.2em;
  font-size: 0.8rem;
  opacity: 1;
}

.form-group input:focus + .form-label::before,
.form-group input:focus + .form-label::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
}

.form-group input:focus + .form-label::before {
  color: var(--secondary-color);
  animation: glitch-anim var(--glitch-anim-duration)
    cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.form-group input:focus + .form-label::after {
  color: var(--primary-color);
  animation: glitch-anim var(--glitch-anim-duration)
    cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both;
}

@keyframes glitch-anim {
  0% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
  20% {
    transform: translate(-5px, 3px);
    clip-path: inset(50% 0 20% 0);
  }
  40% {
    transform: translate(3px, -2px);
    clip-path: inset(20% 0 60% 0);
  }
  60% {
    transform: translate(-4px, 2px);
    clip-path: inset(80% 0 5% 0);
  }
  80% {
    transform: translate(4px, -3px);
    clip-path: inset(30% 0 45% 0);
  }
  100% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
}

/* --- Button Styling --- */
.submit-btn {
  width: 100%;
  padding: 0.8em;
  margin-top: 1rem;
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  overflow: hidden;
}

.submit-btn:hover,
.submit-btn:focus {
  background-color: var(--primary-color);
  color: var(--bg-color);
  box-shadow: 0 0 25px var(--primary-color);
  outline: none;
}

.submit-btn:active {
  transform: scale(0.97);
}

/* --- Glitch Effect for Button --- */
.submit-btn .btn-text {
  position: relative;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.submit-btn:hover .btn-text {
  opacity: 0;
}

.submit-btn::before,
.submit-btn::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background-color: var(--primary-color);
  transition: opacity 0.2s ease;
}

.submit-btn:hover::before,
.submit-btn:focus::before {
  opacity: 1;
  color: var(--secondary-color);
  animation: glitch-anim var(--glitch-anim-duration)
    cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.submit-btn:hover::after,
.submit-btn:focus::after {
  opacity: 1;
  color: var(--bg-color);
  animation: glitch-anim var(--glitch-anim-duration)
    cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both;
}

/* --- Root Variables & Wrapper --- */
.glitch-checkbox-wrapper {
  --disabled-color: #555;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-family: var(--font-family);
  background-color: #050505;
  padding: 2rem;
  border-radius: 1rem;
}

/* --- Container Checkbox --- */
.glitch-checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.glitch-checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* --- Checkbox --- */
.checkbox-box {
  width: 1.5em;
  height: 1.5em;
  border: 2px solid var(--primary-color);
  position: relative;
  transition: all 0.3s ease;

  clip-path: polygon(
    15% 0,
    85% 0,
    100% 15%,
    100% 85%,
    85% 100%,
    15% 100%,
    0 85%,
    0 15%
  );
}

.checkbox-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  background-color: var(--primary-color);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  clip-path: inherit;
}

/* --- Label --- */
.checkbox-label {
  color: var(--text-color);
  font-weight: 500;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

/* --- Checked --- */
.glitch-checkbox-container input:checked + .checkbox-box .checkbox-mark {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: glitch-anim-checkbox 0.3s both;
}

.glitch-checkbox-container input:checked ~ .checkbox-label {
  color: var(--primary-color);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.7);
}

/* --- Hover --- */
.glitch-checkbox-container:hover .checkbox-box {
  box-shadow: 0 0 10px var(--primary-color);
}

.glitch-checkbox-container:hover .checkbox-label::before,
.glitch-checkbox-container:hover .checkbox-label::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #050505;
}

.glitch-checkbox-container:hover .checkbox-label::before {
  color: var(--secondary-color);
  animation: glitch-anim-text 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.glitch-checkbox-container:hover .checkbox-label::after {
  color: var(--primary-color);
  animation: glitch-anim-text 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both;
}

/* ---  Disabled --- */
.glitch-checkbox-container:has(input:disabled) {
  cursor: not-allowed;
}

.glitch-checkbox-container input:disabled + .checkbox-box {
  border-color: var(--disabled-color);
  opacity: 0.5;
  box-shadow: none;
}

.glitch-checkbox-container input:disabled ~ .checkbox-label {
  color: var(--disabled-color);
  text-shadow: none;
}

.glitch-checkbox-container:has(input:disabled):hover .checkbox-box {
  box-shadow: none;
}
.glitch-checkbox-container:has(input:disabled):hover .checkbox-label::before,
.glitch-checkbox-container:has(input:disabled):hover .checkbox-label::after {
  content: none;
}

.remember-me {
  margin: 0.5rem 0 0;
}

.register-container {
  margin-top: 1.5rem;
}

.register-container[style*="display: none"] {
  margin-top: 0;
}

@keyframes glitch-anim-checkbox {
  0% {
    transform: translate(-50%, -50%);
    clip-path: inset(0 0 0 0);
  }
  20% {
    transform: translate(calc(-50% - 3px), calc(-50% + 2px));
    clip-path: inset(50% 0 20% 0);
  }
  40% {
    transform: translate(calc(-50% + 2px), calc(-50% - 1px));
    clip-path: inset(20% 0 60% 0);
  }
  60% {
    transform: translate(calc(-50% - 2px), calc(-50% + 1px));
    clip-path: inset(80% 0 5% 0);
  }
  80% {
    transform: translate(calc(-50% + 2px), calc(-50% - 2px));
    clip-path: inset(30% 0 45% 0);
  }
  100% {
    transform: translate(-50%, -50%);
    clip-path: inset(0 0 0 0);
  }
}

@keyframes glitch-anim-text {
  0% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
  20% {
    transform: translate(-3px, 2px);
    clip-path: inset(50% 0 20% 0);
  }
  40% {
    transform: translate(2px, -1px);
    clip-path: inset(20% 0 60% 0);
  }
  60% {
    transform: translate(-2px, 1px);
    clip-path: inset(80% 0 5% 0);
  }
  80% {
    transform: translate(2px, -2px);
    clip-path: inset(30% 0 45% 0);
  }
  100% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
}

.overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.overlay-panel__card {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px;
}

.register-modal-card {
  max-width: 420px;
}

.icon-close {
  border: none;
  background: transparent;
  color: var(--primary-color);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.role-note {
  margin: 0.35rem 0 0.75rem;
  color: rgba(232, 255, 239, 0.78);
  font-size: 0.88rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .form-group input:focus + .form-label::before,
  .form-group input:focus + .form-label::after,
  .submit-btn:hover::before,
  .submit-btn:focus::before,
  .submit-btn:hover::after,
  .submit-btn:focus::after,
  .glitch-checkbox-container input:checked + .checkbox-box .checkbox-mark,
  .glitch-checkbox-container:hover .checkbox-label::before,
  .glitch-checkbox-container:hover .checkbox-label::after {
    animation: none;
  }

  .glitch-checkbox-container input:checked + .checkbox-box .checkbox-mark {
    opacity: 1;
  }

  .submit-btn:hover .btn-text {
    opacity: 1;
  }
}
