/* Valdouro auth surfaces — Zurich light, private-client access */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fo-bg);
  color: var(--fo-text);
  font-family: var(--fo-font-sans);
  position: relative;
}

.auth-page__top {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 2;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4.5rem);
  background:
    linear-gradient(180deg, #fbfaf7 0%, var(--fo-bg) 100%);
  border-right: 1px solid var(--fo-b);
  overflow: hidden;
}

.auth-brand__geometry {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.auth-brand__geometry svg {
  position: absolute;
  width: min(72%, 420px);
  height: auto;
  color: var(--fo-primary);
  opacity: 0.08;
}

.auth-brand__geometry svg:first-child {
  top: 8%;
  left: -6%;
}

.auth-brand__geometry svg:last-child {
  right: -8%;
  bottom: 10%;
  width: min(48%, 280px);
  opacity: 0.06;
}

.auth-brand__inner {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.auth-brand .pc-brand--auth {
  margin-bottom: 2rem;
}

.auth-brand__greeting {
  margin: 0 0 0.75rem;
  color: var(--fo-text);
  font-family: var(--fo-font-display);
  font-size: clamp(1.85rem, 2.6vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-brand__lede {
  margin: 0;
  max-width: 22rem;
  color: var(--fo-sub);
  font-size: 1rem;
  line-height: 1.55;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--fo-surface);
}

.auth-panel__inner {
  width: 100%;
  max-width: 24rem;
}

.auth-panel__mobile-brand {
  display: none;
  margin-bottom: 1.75rem;
}

.auth-panel__title {
  margin: 0 0 0.4rem;
  color: var(--fo-text);
  font-family: var(--fo-font-display);
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-panel__subtitle {
  margin: 0 0 1.75rem;
  color: var(--fo-sub);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-status {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--fo-success) 28%, var(--fo-b));
  border-radius: var(--fo-radius-sm);
  background: var(--fo-success-soft);
  color: var(--fo-success);
  font-size: 0.875rem;
}

.auth-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--fo-danger) 28%, var(--fo-b));
  border-radius: var(--fo-radius-sm);
  background: var(--fo-danger-soft);
  color: var(--fo-danger);
  font-size: 0.875rem;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field__label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--fo-mid);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-field__control {
  position: relative;
}

.auth-input {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--fo-b2);
  border-radius: var(--fo-radius-sm);
  background: var(--fo-surface);
  color: var(--fo-text);
  font: inherit;
  transition: border-color var(--fo-duration) var(--fo-ease), box-shadow var(--fo-duration) var(--fo-ease);
}

.auth-input--with-action {
  padding-right: 3.25rem;
}

.auth-input:hover {
  border-color: color-mix(in srgb, var(--fo-primary) 28%, var(--fo-b2));
}

.auth-input:focus-visible {
  border-color: var(--fo-primary);
  box-shadow: var(--fo-focus-ring);
  outline: 2px solid transparent;
}

.auth-input[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--fo-danger) 55%, var(--fo-b2));
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.55rem;
  border: 0;
  border-radius: var(--fo-radius-sm);
  background: transparent;
  color: var(--fo-sub);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: var(--fo-primary);
}

.auth-password-toggle:focus-visible {
  box-shadow: var(--fo-focus-ring);
  outline: 2px solid transparent;
}

.auth-error {
  margin: 0.35rem 0 0;
  color: var(--fo-danger);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.35rem 0 1.35rem;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  color: var(--fo-mid);
  font-size: 0.875rem;
  cursor: pointer;
}

.auth-remember input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--fo-primary);
}

.auth-link {
  color: var(--fo-primary);
  font-size: 0.875rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.auth-link:hover {
  border-bottom-color: color-mix(in srgb, var(--fo-primary) 40%, transparent);
}

.auth-link:focus-visible {
  box-shadow: var(--fo-focus-ring);
  outline: 2px solid transparent;
  border-radius: 2px;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: var(--fo-radius-sm);
  background: var(--fo-primary);
  color: var(--fo-on-primary);
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color var(--fo-duration) var(--fo-ease);
}

.auth-submit:hover {
  background: var(--fo-primary-hover);
}

.auth-submit:focus-visible {
  box-shadow: var(--fo-focus-ring);
  outline: 2px solid transparent;
}

.auth-admin-note {
  margin: 0 0 1.25rem;
  color: var(--fo-sub);
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 1023px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding:
      max(1.5rem, env(safe-area-inset-top))
      max(1.25rem, env(safe-area-inset-right))
      max(1.5rem, env(safe-area-inset-bottom))
      max(1.25rem, env(safe-area-inset-left));
  }

  .auth-panel__mobile-brand {
    display: flex;
    justify-content: center;
  }

  .auth-panel__mobile-brand .pc-brand--default {
    gap: 0.75rem;
  }

  .auth-panel__mobile-brand .pc-brand__mark {
    width: 56px;
    height: 56px;
  }

  .auth-panel__mobile-brand .pc-brand__wordmark {
    display: inline;
    font-size: 1.35rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .auth-panel__inner {
    max-width: 26rem;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-input,
  .auth-submit,
  .auth-link {
    transition: none;
  }
}
