/* Auth Pages — SKØNGADE branded (extends site rose system) */
:root {
  --auth-rose: #7C4A85;
  --auth-rose-deep: #4A2E4D;
  --auth-rose-ink: #3A243D;
  --auth-brand-font: "Syne", "Avenir Next", "Segoe UI", sans-serif;
}

.auth-page {
  --header-height: 88px;
  background:
    radial-gradient(1200px 520px at 12% -10%, rgba(124, 74, 133, 0.18), transparent 60%),
    radial-gradient(900px 480px at 92% 8%, rgba(158, 63, 88, 0.12), transparent 55%),
    linear-gradient(180deg, #faf7f8 0%, #f3eef0 48%, #faf7f8 100%);
  min-height: calc(100vh - var(--header-height));
  padding: var(--space-12) 0 var(--space-16);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='%23C45B74' fill-opacity='0.18'/%3E%3C/svg%3E");
}

.auth-page > .container {
  position: relative;
  z-index: 1;
}

/* Hero — brand first */
.auth-hero {
  text-align: center;
  margin-bottom: var(--space-10);
  animation: authRise 0.55s ease both;
}

.auth-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 var(--space-4);
}

.auth-brand-logo {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.auth-brand-name {
  font-family: var(--auth-brand-font);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--auth-rose-ink);
  text-transform: none;
}

.auth-hero-title {
  font-family: var(--auth-brand-font);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
}

.auth-hero-copy {
  color: var(--color-gray-600);
  font-size: var(--font-size-lg);
  max-width: 34rem;
  margin: 0 auto;
  line-height: 1.6;
}

/* Legacy eyebrow (register / other auth pages) */
.auth-hero .eyebrow {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--auth-rose);
  background: rgba(124, 74, 133, 0.1);
  padding: var(--space-2) var(--space-4);
  border-radius: 6px;
  margin-bottom: var(--space-4);
}

.auth-hero h1:not(.auth-hero-title) {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--color-gray-900);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
}

.auth-hero p:not(.auth-hero-copy):not(.auth-brand) {
  color: var(--color-gray-500);
  font-size: var(--font-size-lg);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main Shell — fill site .container */
.auth-shell {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: var(--space-8);
  box-shadow: 0 18px 50px -28px rgba(122, 48, 69, 0.35);
  border: 1px solid rgba(124, 74, 133, 0.16);
  width: 100%;
  max-width: none;
  margin: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  animation: authRise 0.65s ease 0.08s both;
}

/* Illustration Side — brand panel */
.auth-illustration {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(160deg, var(--auth-rose) 0%, var(--auth-rose-deep) 55%, var(--auth-rose-ink) 100%);
  border-radius: 14px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  min-height: 100%;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

.auth-illustration::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 280px at 80% 15%, rgba(255, 255, 255, 0.22), transparent 70%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='white' opacity='0.16'/%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-illustration > * {
  position: relative;
  z-index: 1;
}

.auth-illustration-brand {
  font-family: var(--auth-brand-font);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 1.25rem;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.auth-illustration-title {
  font-family: var(--auth-brand-font);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.auth-illustration-copy {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
  font-size: 1.02rem;
  margin: 0 0 1.5rem;
  max-width: 28rem;
}

.auth-illustration-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.auth-illustration-points li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.auth-illustration-points li::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #f6d9e1;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

/* Legacy illustration title/copy (non-branded auth pages) */
.auth-illustration h3 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.auth-illustration p {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  font-size: var(--font-size-base);
}

.auth-illustration .stat {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: #f6d9e1;
}

.auth-illustration small {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
}

/* Form Side */
.auth-form {
  padding: var(--space-4) var(--space-6);
}

.auth-form-title {
  font-family: var(--auth-brand-font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.auth-form .form-label {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  margin-bottom: var(--space-2);
}

.auth-input {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
  background: var(--color-white);
  transition: all 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: #7C4A85;
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(124, 74, 133, 0.1);
  transform: translateY(-1px);
}

.auth-input.is-valid {
  border-color: #10b981;
  background-image: none;
}

.auth-input.is-invalid {
  border-color: #ef4444;
  background-image: none;
}

.auth-input::placeholder {
  color: var(--color-gray-400);
}

/* Input Group Enhancements */
.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.input-group .auth-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  background: var(--color-white);
  border: 1px solid #e2e8f0;
  border-left: none;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  transition: all 0.2s ease;
}

.email-validation-icon {
  background: transparent;
  border: none;
}

/* Password Toggle Button */
.password-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  border: 1px solid #e2e8f0;
  border-left: none;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  background: var(--color-white);
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
}

.password-toggle:hover {
  color: #7C4A85;
  background: rgba(124, 74, 133, 0.05);
  border-color: #7C4A85;
}

.password-toggle:focus {
  outline: 2px solid #7C4A85;
  outline-offset: 2px;
  z-index: 10;
}

.password-toggle i {
  font-size: 1rem;
}

/* Focused Input Group */
.input-group.focused .auth-input,
.input-group.focused .input-group-text,
.input-group.focused .password-toggle {
  border-color: #7C4A85;
}

.input-group.focused .input-group-text,
.input-group.focused .password-toggle {
  box-shadow: 0 0 0 3px rgba(124, 74, 133, 0.1);
}

/* Validation Feedback — hidden until field is invalid */
.invalid-feedback {
  display: none;
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  color: #ef4444;
  animation: slideDown 0.2s ease;
}

.mb-3:has(.auth-input.is-invalid) > .invalid-feedback,
.auth-input.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Meta Row */
.auth-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  margin-top: var(--space-4);
}

.auth-meta .form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.auth-meta .form-check-input {
  width: 18px;
  height: 18px;
  accent-color: #7C4A85;
  cursor: pointer;
}

.auth-meta a {
  color: #7C4A85;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.auth-meta a:hover {
  color: #4A2E4D;
}

/* Submit Button */
.auth-submit {
  width: 100%;
  border-radius: 6px;
  border: none;
  padding: var(--space-4);
  font-size: var(--font-size-base);
  font-weight: 700;
  background: linear-gradient(135deg, #7C4A85 0%, #4A2E4D 100%);
  color: var(--color-white);
  cursor: pointer;
  margin-top: var(--space-6);
  transition: all 0.2s ease;
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #4A2E4D 0%, #3A243D 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 74, 133, 0.2);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(124, 74, 133, 0.2);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-submit .submit-spinner {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--color-gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--font-size-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-gray-200);
}

/* Social Buttons */
.auth-social button {
  width: 100%;
  border-radius: 6px;
  padding: var(--space-3);
  border: 1px solid #e2e8f0;
  background: var(--color-white);
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-social button:hover {
  border-color: #7C4A85;
  background: rgba(124, 74, 133, 0.05);
  color: #7C4A85;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 74, 133, 0.1);
}

/* Bottom Note */
.auth-bottom-note {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-gray-100);
  color: var(--color-gray-500);
  font-size: var(--font-size-sm);
}

.auth-bottom-note a {
  color: #7C4A85;
  font-weight: 600;
  text-decoration: none;
  margin-left: var(--space-1);
}

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

/* Alert */
.auth-page .alert {
  padding: var(--space-4);
  border-radius: 6px;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  animation: slideDown 0.3s ease;
}

.auth-page .alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-page .alert-info {
  background: rgba(124, 74, 133, 0.1);
  color: #4A2E4D;
  border: 1px solid rgba(124, 74, 133, 0.3);
}

.auth-page .alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.auth-page .alert .btn-close {
  margin-left: auto;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.auth-page .alert .btn-close:hover {
  opacity: 1;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes authRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.auth-form {
  animation: fadeIn 0.4s ease;
}

/* Perks Section — same width as shell / site container */
.auth-perks {
  margin-top: var(--space-12);
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.auth-perk-card {
  background: var(--color-white);
  border-radius: 8px;
  padding: var(--space-6);
  height: 100%;
  box-shadow: none;
  border: 1px solid #e2e8f0;
  text-align: center;
  transition: all 0.2s ease;
}

.auth-perk-card:hover {
  border-color: #7C4A85;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 74, 133, 0.1);
}

.auth-perk-card h3,
.auth-perk-card h4 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--color-gray-900);
}

.auth-perk-card p {
  color: var(--color-gray-500);
  line-height: 1.6;
  font-size: var(--font-size-sm);
  margin: 0;
}

/* Responsive */
@media (max-width: 991.98px) {
  .auth-shell {
    padding: var(--space-6);
  }

  .auth-hero h1 {
    font-size: var(--font-size-3xl);
  }

  .auth-illustration {
    margin-bottom: var(--space-6);
    padding: var(--space-6);
    min-height: 240px;
  }

  .auth-illustration-brand {
    font-size: 2.25rem;
  }
  
  .auth-form {
    padding: var(--space-4) 0;
  }

  .auth-brand-name {
    font-size: 2.35rem;
  }
}

@media (max-width: 575.98px) {
  .auth-page {
    padding: var(--space-8) 0 var(--space-12);
  }
  
  .auth-hero h1 {
    font-size: var(--font-size-2xl);
  }
  
  .auth-hero p {
    font-size: var(--font-size-base);
  }
  
  .auth-shell {
    padding: var(--space-4);
  }

  .auth-meta {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
  }

  /* Prevent iOS zoom on input focus */
  .auth-input {
    font-size: 16px;
    min-height: 44px;
  }

  .auth-submit {
    min-height: 48px;
    font-size: 1rem;
  }
}

/* Dark Theme */
[data-theme="dark"] .auth-page {
  background: var(--color-gray-900);
}

[data-theme="dark"] .auth-hero h1 {
  color: var(--color-white);
}

[data-theme="dark"] .auth-shell,
[data-theme="dark"] .auth-perk-card {
  background: var(--color-gray-800);
}

[data-theme="dark"] .auth-input {
  background: var(--color-gray-700);
  border-color: var(--color-gray-600);
  color: var(--color-white);
}

[data-theme="dark"] .auth-input:focus {
  background: var(--color-gray-700);
}

[data-theme="dark"] .auth-social button {
  background: var(--color-gray-700);
  border-color: var(--color-gray-600);
  color: var(--color-gray-300);
}

[data-theme="dark"] .auth-perk-card h4 {
  color: var(--color-white);
}

[data-theme="dark"] .password-toggle {
  background: var(--color-gray-700);
  border-color: var(--color-gray-600);
  color: var(--color-gray-400);
}

[data-theme="dark"] .password-toggle:hover {
  background: var(--color-gray-600);
  color: #7C4A85;
  border-color: #7C4A85;
}

[data-theme="dark"] .input-group-text {
  background: var(--color-gray-700);
  border-color: var(--color-gray-600);
}
