/* Auth theme - shared design for identity pages */
body {
  margin: 0;
  font-family: var(--auth-font-sans);
  background-color: hsl(297 35% 43%);
  color: var(--auth-foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --auth-background: hsl(0 0% 100%);
  --auth-foreground: hsl(222.2 84% 4.9%);
  --auth-card: hsl(0 0% 100%);
  --auth-card-foreground: hsl(222.2 84% 4.9%);
  --auth-primary: hsl(297 35% 43%);
  --auth-tertiary: hsl(267 34% 47%);
  --auth-primary-foreground: hsl(0 0% 100%);
  --auth-muted: hsl(210 40% 96.1%);
  --auth-muted-foreground: hsl(215.4 16.3% 46.9%);
  --auth-destructive: hsl(0 84.2% 60.2%);
  --auth-border: hsl(214.3 31.8% 91.4%);
  --auth-input: hsl(214.3 31.8% 91.4%);
  --auth-radius: 0.5rem;
  --auth-font-sans: "Inter", system-ui, sans-serif;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: hsl(297 35% 43%);
}

.auth-page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 10;
}

/* Card wrapper: w-full max-w-[440px] relative */
.auth-card-wrapper {
  width: 100%;
  max-width: 440px;
  min-width: 0;
  position: relative;
}

/* Card: rounded-xl border bg-card p-6 lg:p-8 shadow-xl border-border/80 */
.auth-card {
  background: var(--auth-card);
  color: var(--auth-card-foreground);
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  border: 1px solid hsla(214.3, 31.8%, 91.4%, 0.8);
  box-sizing: border-box;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .auth-card {
    padding: 2rem;
  }
}

/* Card header: flex items-center gap-2 mb-5 */
.auth-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-card-header img {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

/* Card title: text-lg font-semibold text-foreground */
.auth-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--auth-foreground);
  margin: 0;
}

.auth-operator-banner {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: hsla(210, 40%, 96.1%, 0.5);
}

.auth-operator-banner h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--auth-foreground);
  margin: 0 0 0.25rem 0;
}

.auth-operator-banner p {
  font-size: 0.875rem;
  color: var(--auth-muted-foreground);
  margin: 0;
}

.auth-operator-banner .operator-name {
  color: var(--auth-primary);
  font-weight: 500;
}

.auth-operator-banner img {
  margin-top: 0.75rem;
  height: 50px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Social buttons: space-y-3 mb-4 */
.auth-social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-width: 0;
}

/* Button: Tailwind h-10 px-5 py-2 text-sm font-medium gap-2 rounded-lg */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
  box-sizing: border-box;
  min-width: 0;
  outline: none;
}
.auth-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--auth-background), 0 0 0 4px var(--auth-primary);
}
.auth-btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}
.auth-btn svg {
  pointer-events: none;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.auth-btn-outline {
  background: var(--auth-background);
  border: 1px solid hsla(214.3, 31.8%, 91.4%, 0.6);
  color: var(--auth-foreground);
}
.auth-btn-outline:hover {
  background: var(--auth-muted);
  color: var(--auth-foreground);
}

.auth-btn-outline.full-width {
  width: 100%;
  max-width: 100%;
}

.auth-btn-outline img {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Splitter: border-t border-border my-6 relative */
.auth-divider {
  border: none;
  border-top: 1px solid var(--auth-border);
  margin: 1.5rem 0;
  padding: 0;
  position: relative;
}

/* Legend: px-2 text-xs absolute left-1/2 -translate-x-1/2 -top-2.5 bg-card text-center */
.auth-divider-legend {
  position: absolute;
  left: 50%;
  top: -0.625rem;
  transform: translateX(-50%);
  padding: 0 0.5rem;
  font-size: 0.75rem;
  color: var(--auth-muted-foreground);
  background: var(--auth-card);
  text-align: center;
}

/* Form: space-y-4 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.auth-error-message {
  border-radius: 0.5rem;
  border: 1px solid hsla(0, 84.2%, 60.2%, 0.3);
  background: hsla(0, 84.2%, 60.2%, 0.1);
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--auth-destructive);
}

/* Form group: mb-4 */
.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  margin-bottom: 0;
}

/* Label row: flex items-center mb-1 */
.auth-form-label-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.auth-form-hint-link {
  font-size: 0.75rem;
  color: var(--auth-primary);
  text-decoration: none;
}
.auth-form-hint-link:hover {
  text-decoration: underline;
}

.auth-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--auth-foreground);
  flex: 1;
  margin-bottom: 0.5rem;
}
.auth-form-label-row .auth-form-label {
  margin-bottom: 0;
}

/* Input: h-10 w-full rounded-lg border border-border/70 bg-background px-3 py-2 text-sm shadow-sm */
.auth-form-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid hsla(214.3, 31.8%, 91.4%, 0.7);
  border-radius: 0.5rem;
  background: var(--auth-background);
  color: var(--auth-foreground);
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form-input::placeholder {
  color: var(--auth-muted-foreground);
}
.auth-form-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--auth-background), 0 0 0 4px var(--auth-primary);
}
.auth-form-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.auth-form-input.auth-input-error {
  border-color: var(--auth-destructive);
}
.auth-form-input.auth-input-error:focus-visible {
  box-shadow: 0 0 0 2px var(--auth-background), 0 0 0 4px var(--auth-destructive);
}

/* Input wrapper: relative */
.auth-input-wrapper {
  position: relative;
  min-width: 0;
}

.auth-input-wrapper .auth-form-input {
  padding-right: 2.5rem;
}

/* Toggle: absolute right-2 top-1/2 -translate-y-1/2 z-10 h-8 w-8 rounded-md hover:bg-accent */
.auth-toggle-password {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--auth-muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
}

.auth-toggle-password:hover {
  background: var(--auth-muted);
  color: var(--auth-foreground);
}

/* Primary button: bg-gradient-to-tr from-primary to-tertiary h-10 px-5 py-2 rounded-lg w-full */
.auth-btn-primary {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(to top right, var(--auth-primary), var(--auth-tertiary));
  color: var(--auth-primary-foreground);
  border: none;
  gap: 0.5rem;
}

.auth-btn-primary:hover:not(:disabled) {
  background: linear-gradient(to top left, var(--auth-primary), var(--auth-tertiary));
  opacity: 0.95;
}

.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Card footer: mt-6 pt-4 border-t border-border text-center */
.auth-card-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--auth-border);
  text-align: center;
}

.auth-card-footer p {
  font-size: 0.875rem;
  color: var(--auth-muted-foreground);
  margin: 0;
}

.auth-card-footer a {
  color: var(--auth-primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-card-footer a:hover {
  text-decoration: underline;
}

/* Bottom links: flex justify-center gap-4 mt-4 text-sm text-white/80 */
.auth-bottom-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.auth-bottom-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.auth-bottom-links a:hover {
  color: white;
}

/* Footer: Tailwind py-6 text-center relative z-10 text-white */
.auth-page-footer {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  text-align: center;
  position: relative;
  z-index: 10;
  color: white;
}

.auth-page-footer img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  height: 1.25rem;
  width: auto;
  filter: brightness(0) invert(1);
}

.auth-page-footer .tagline {
  margin-top: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
}

.auth-page-footer .blurb {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.auth-page-footer .copyright {
  margin-top: 0.75rem;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-loading-overlay {
  position: absolute;
  inset: 0;
  background: hsla(0, 0%, 100%, 0.9);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.auth-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--auth-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

.auth-card-relative {
  position: relative;
}

.auth-hidden {
  display: none;
}

.auth-checkbox-group {
  margin: 1.25rem 0 0 0;
}

.auth-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.auth-checkbox-group input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1rem;
  height: 1rem;
}

.auth-checkbox-group label {
  font-size: 0.875rem;
  color: var(--auth-muted-foreground);
  margin: 0;
}

/* Terms: line-clamp-2 text-xs text-muted-foreground */
.auth-terms-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--auth-muted-foreground);
  line-height: 1.4;
}

.auth-terms-text a {
  color: var(--auth-primary);
  text-decoration: none;
}

.auth-terms-text a:hover {
  text-decoration: underline;
}

.auth-wider {
  max-width: 540px;
}

/* Utility classes for components that need them */
.auth-flex { display: flex; }
.auth-align-center { align-items: center; }
.auth-ml-auto { margin-left: auto; }
.d-none { display: none !important; }

/* Language selector (from old _footer.scss) */
.lang-icon {
  width: 20px;
  height: 20px;
  border-radius: 0.25rem;
}
.lang-selector {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 5px 8px;
}
.lang-selector:hover {
  background: white;
}
.lang-toggle {
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.drop-links {
  position: absolute;
  top: 40px;
  right: -1px;
  border-radius: 0.5rem;
  box-shadow: 1px 0 15px 0px rgba(60, 60, 60, 0.55);
  background: white;
  z-index: 100;
}
.drop-links ul {
  margin-bottom: 0 !important;
}
.list-group-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  width: 100%;
  text-align: left;
}
.list-group-item:hover {
  background: var(--auth-muted);
}

/* Consent / Grants list styles */
.auth-scope-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  overflow: hidden;
}

.auth-scope-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--auth-border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-scope-item:last-child {
  border-bottom: none;
}

.auth-scope-item label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  margin: 0;
}

.auth-scope-item input[type="checkbox"] {
  margin-top: 0.2rem;
}

.auth-scope-section {
  margin-bottom: 1.5rem;
}

.auth-scope-section-title {
  padding: 0.75rem 1rem;
  background: var(--auth-muted);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--auth-radius) var(--auth-radius) 0 0;
}

.auth-scope-section .auth-scope-list {
  border-top: none;
  border-radius: 0 0 var(--auth-radius) var(--auth-radius);
}

/* User card: matches Portal change password / logout design */
.auth-user-card {
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid hsla(214.3, 31.8%, 91.4%, 0.7);
  background: hsla(210, 40%, 96.1%, 0.3);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-user-card-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--auth-border);
  flex-shrink: 0;
}

.auth-user-card-content {
  min-width: 0;
  flex: 1;
}

.auth-user-card-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--auth-foreground);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.125rem;
}

.auth-user-card-meta img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.auth-user-card-email {
  font-size: 0.875rem;
  color: var(--auth-muted-foreground);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
