/* ── Brand Typography ────────────────────────────────────── */
.brand-text {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

/* ── Shell Adjustments ───────────────────────────────────── */
.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Consolidated Card Architecture ──────────────────────── */
.card {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  background: var(--black); /* Fallback background */
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 1px; /* The thickness of the moving border */
  z-index: 1;
}

/* The moving gradient layer (confined strictly behind the inner card) */
.card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 120deg, var(--blue) 180deg, var(--pink) 240deg, transparent 300deg, transparent 360deg);
  animation: rotateFlow 4s linear infinite;
  z-index: -2;
}

/* The solid inner mask — completely blocks the background from moving */
.card::after {
  content: "";
  position: absolute;
  inset: 1px; /* Exposes exactly 1px of the moving gradient underneath */
  background-color: #0d0d1a; /* Enforces a solid, opaque dark background */
  border-radius: calc(var(--radius-card) - 1px);
  z-index: -1;
}

.card-content {
  position: relative;
  z-index: 2;
  padding: 25px;
  background: transparent; /* Ensures content doesn't fight the mask */
}

/* ── Border Flow Animation ────────────────────────────────── */
@keyframes rotateFlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ── Header Styling ──────────────────────────────────────── */
.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}

.card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.auth-heading-group h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 4px;
}

.auth-heading-group p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Layout & Structure ──────────────────────────────────── */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 5px;
}

.message {
  text-align: center;
  padding: 16px 0;
  margin-bottom: 20px;
  border-radius: 10px;
  font-size: 14px;
}

.message.success {
  background: #033603;
  border: 2px solid #00800059;
}

.message.error {
  background: #540707;
  border: 2px solid #700;
}

/* ── Typography & Input Fields ───────────────────────────── */
label {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  padding: 15px;
  outline: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

input::placeholder {
  color: rgba(156, 163, 175, 0.4);
}

/* ── Password Wrapping Group ─────────────────────────────── */
.password-group {
  position: relative;
  width: 100%;
}

.password-group input {
  padding-right: 53px;
}

.toggle-password {
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  padding: 8px !important;
  margin: 0 8px 0 0 !important;
  cursor: pointer !important;
  color: var(--muted) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  transition: var(--transition) !important;
  width: auto !important;
  box-shadow: none !important;
}

.toggle-password:hover {
  color: var(--white) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Contextual Links & Checkboxes ──────────────────────── */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: normal;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--blue);
  cursor: pointer;
}

.auth-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
  color: var(--pink);
}

.auth-link:hover {
  color: var(--white);
}

.auth-actions {
  position: absolute;
  top: 35px;
  left: 10px;
  border-radius: 7px;
}

.back-link {
  font-size: 1rem;
  color: var(--white);
  width: 40px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Primary Authentication Button ───────────────────────── */
.submit-button.login-button {
  background: var(--accent-gradient);
  padding: 18px 0;
  font-size: 0.87rem;
  letter-spacing: 0.05em;
  margin-top: 10px;
  text-transform: uppercase;
}

/* ── Clear Global Base Styles Override ───────────────────── */
.page-shell > .card {
  max-width: 430px;
  user-select: none;
}
