:root {
  --clr-theme-purple: #7c4dff;
  --clr-theme-purple-hover: #5a2ade;
  --clr-text: #475569; /* Slate 600 */
  --clr-text-light: #94a3b8; /* Slate 400 */
  --clr-black: #0f172a; /* Slate 900 */
  --clr-slate: #64748b; /* Slate 500 */
  --clr-error: #ef4444; /* Red 500 */
  --clr-blue-link: #2563eb; /* Blue 600 */
  --clr-bg: #f8fafc; /* Slate 50 */
  --clr-border: #e2e8f0; /* Slate 200 */
}

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

* {
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  background-color: var(--clr-bg);
  color: var(--clr-black);
}

.auth-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  padding: 2rem 1.5rem;
  background: radial-gradient(circle at 0% 0%, rgba(124, 77, 255, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
              var(--clr-bg);
  position: relative;
  overflow: hidden;
}

/* Background decorative blobs */
.auth-container::before,
.auth-container::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

.auth-container::before {
  top: 10%;
  left: 5%;
  background: rgba(124, 77, 255, 0.15);
}

.auth-container::after {
  bottom: 10%;
  right: 5%;
  background: rgba(37, 99, 235, 0.12);
}

/* Logo and header container */
.auth-container .logo-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 10;
}

.auth-container .logo-wrapper .logo {
  width: 48px;
  height: auto;
  flex-shrink: 0;
}

.text-logo {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--clr-theme-purple);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  white-space: nowrap;
}

.text-login {
  font-size: 1.5rem;
  color: var(--clr-theme-purple);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Portal Badge */
.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(124, 77, 255, 0.08);
  color: var(--clr-theme-purple);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border: 1px solid rgba(124, 77, 255, 0.15);
}

.portal-badge .badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--clr-theme-purple);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(124, 77, 255, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(124, 77, 255, 0);
  }
}

/* Card container */
.auth-container .auth-wrapper {
  width: 100%;
  max-width: 480px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

/* Accent top bar on the card */
.auth-container .auth-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--clr-theme-purple) 0%, var(--clr-blue-link) 100%);
}

.auth-container .auth-wrapper .description {
  color: var(--clr-slate);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.form-group label {
  color: var(--clr-slate);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

/* Inputs and Selects */
.input-wrapper input,
.input-wrapper select {
  border: 1px solid var(--clr-border);
  font-size: 0.95rem;
  height: 3.25rem;
  padding: 0.5rem 1rem;
  padding-left: 2.75rem;
  border-radius: 8px;
  width: 100%;
  transition: all 0.2s ease;
  background-color: #f8fafc;
  color: var(--clr-black);
  outline: none;
  font-family: inherit;
}

.input-wrapper select {
  padding-left: 1rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--clr-theme-purple);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
  background-color: #ffffff;
}

.input-wrapper input::placeholder {
  color: var(--clr-text-light);
}

.input-wrapper input:disabled {
  background-color: #f1f5f9;
  color: var(--clr-slate);
  cursor: not-allowed;
}

/* Input icons */
.input-wrapper .icon {
  position: absolute;
  left: 1rem;
  color: var(--clr-slate);
  width: 20px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.input-wrapper .icon.btn-icon {
  position: absolute;
  right: 0.5rem;
  left: auto;
  pointer-events: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-wrapper .icon.btn-icon:hover {
  background-color: #f1f5f9;
}

.input-wrapper .icon.btn-icon i {
  font-size: 1.1rem;
  color: var(--clr-slate);
}

/* Errors */
.input-wrapper.has-error input {
  border-color: var(--clr-error);
}

.input-wrapper.has-error .error {
  display: block;
}

.input-wrapper .error {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  color: var(--clr-error);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Buttons */
.auth-container button {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
}

.auth-container button.primary {
  background: linear-gradient(135deg, var(--clr-theme-purple) 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(124, 77, 255, 0.2);
}

.auth-container button.primary:hover {
  background: linear-gradient(135deg, var(--clr-theme-purple-hover) 0%, #4f46e5 100%);
  box-shadow: 0 10px 15px -3px rgba(124, 77, 255, 0.3);
  transform: translateY(-1px);
}

.auth-container button.primary:active {
  transform: translateY(0);
}

.auth-container button:disabled {
  background-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* SSO / Google Button */
.auth-container button.btn-sso {
  background-color: #ffffff;
  color: var(--clr-black);
  border: 1px solid var(--clr-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.auth-container button.btn-sso:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.auth-container button.btn-sso:active {
  transform: translateY(0);
}

/* Choice screen links */
.auth-container .btn-primary {
  background: linear-gradient(135deg, var(--clr-theme-purple) 0%, #6366f1 100%) !important;
  border: none !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 6px -1px rgba(124, 77, 255, 0.2) !important;
  transition: all 0.2s ease !important;
}

.auth-container .btn-primary:hover {
  background: linear-gradient(135deg, var(--clr-theme-purple-hover) 0%, #4f46e5 100%) !important;
  box-shadow: 0 10px 15px -3px rgba(124, 77, 255, 0.3) !important;
  transform: translateY(-1px);
}

.auth-container .btn-outline-primary {
  border: 2px solid var(--clr-theme-purple) !important;
  color: var(--clr-theme-purple) !important;
  background: transparent !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

.auth-container .btn-outline-primary:hover {
  background-color: rgba(124, 77, 255, 0.05) !important;
  color: var(--clr-theme-purple-hover) !important;
  border-color: var(--clr-theme-purple-hover) !important;
  transform: translateY(-1px);
}

/* Link Button */
.auth-container .link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-container .link-button.primary {
  background-color: var(--clr-theme-purple);
  color: #ffffff;
}

.auth-container .link-button.primary:hover {
  background-color: var(--clr-theme-purple-hover);
}

/* Checkbox Toggle */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.checkbox-container input[type="checkbox"] {
  width: 2.75rem;
  height: 1.5rem;
  cursor: pointer;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  background: #cbd5e1;
  outline: none;
  border-radius: 1rem;
  transition: background-color 0.2s ease;
}

.checkbox-container input[type="checkbox"]:checked {
  background: var(--clr-theme-purple);
}

.checkbox-container input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  top: 0.175rem;
  left: 0.175rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.checkbox-container input[type="checkbox"]:checked::before {
  transform: translateX(1.25rem);
}

.checkbox-container label {
  color: var(--clr-slate);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Links */
.link-primary {
  color: var(--clr-theme-purple);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.link-primary:hover {
  color: var(--clr-theme-purple-hover);
  text-decoration: underline;
}

.tc_privacy {
  color: var(--clr-slate);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
  margin-top: 1rem;
}

.tc_privacy .link {
  color: var(--clr-blue-link);
  text-decoration: none;
  font-weight: 500;
}

.tc_privacy .link:hover {
  text-decoration: underline;
}

/* Activation / OTP */
.activation-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.activation-container h3 {
  color: var(--clr-slate);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

.activation-container .input-wrapper {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.activation-container .input-wrapper .dash {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
}

.activation-container .input-wrapper .dash div {
  width: 0.75rem;
  background: var(--clr-slate);
  height: 0.15rem;
  border-radius: 4px;
}

.activation-container .input-wrapper input {
  font-size: 1.5rem;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  text-align: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  font-weight: 600;
  background-color: #f8fafc;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-container {
    padding: 1.5rem 1rem;
  }

  .auth-container .auth-wrapper {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }
}