/* ==========================================================================
   WooCommerce auth flows (password recovery + logged-out login/register)
   Shared: .account-auth-section, .account-auth-card, .account-auth-form
   ========================================================================== */

.woocommerce-account.woocommerce-lost-password .entry-header,
.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .entry-header {
  display: none;
}

.woocommerce-account.woocommerce-lost-password #content.site-content,
.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) #content.site-content {
  padding-top: 0;
  padding-bottom: 0;
}

.woocommerce-account.woocommerce-lost-password .entry-content,
.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .entry-content {
  padding-left: 0;
  padding-right: 0;
}

.woocommerce-account.woocommerce-lost-password .entry-content > .woocommerce,
.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .entry-content > .woocommerce {
  margin-bottom: 0;
}

/* --- Section (full-bleed calm background) -------------------------------- */

.woocommerce-account.woocommerce-lost-password .account-auth-section,
.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .account-auth-section {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(2rem, 5vw, 6rem) clamp(1rem, 3vw, 1.5rem);
}

/* --- Grid (login + register) --------------------------------------------- */

.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .account-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2rem);
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  align-items: start;
}

.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .account-auth-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 35rem;
}

/* --- Card ---------------------------------------------------------------- */

.account-auth-section .account-auth-card {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--account-card-border);
  border-radius: var(--bs-border-radius-lg);
  background-color: var(--bs-body-bg);
  box-shadow: var(--brand-shadow-md);
}

.woocommerce-account.woocommerce-lost-password .account-auth-section > .account-auth-card,
.woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .account-auth-grid--single > .account-auth-card {
  max-width: 35rem;
  margin-inline: auto;
}

/* --- Back link ----------------------------------------------------------- */

.account-auth-section .account-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
  color: var(--brand-text-soft);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.15s ease;
}

.account-auth-section .account-auth-back:hover {
  color: var(--brand-text-strong);
}

.account-auth-section .account-auth-back:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.account-auth-section .account-auth-back .bi {
  font-size: 0.9375rem;
  line-height: 1;
}

/* --- Title & lead -------------------------------------------------------- */

.account-auth-section .account-auth-title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 1.5rem + 0.6vw, 2.375rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--brand-text-strong);
}

.woocommerce-account.woocommerce-lost-password .account-auth-section .account-auth-title {
  margin-bottom: 0.75rem;
}

.account-auth-section .account-auth-lead {
  margin: 0 0 1.5rem;
  max-width: 32rem;
  color: var(--brand-text-medium);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.account-auth-section .account-auth-lead--confirmation,
.account-auth-section .account-auth-lead--register {
  margin-bottom: 1.25rem;
}

.account-auth-section .account-auth-lead a {
  color: var(--brand-text-strong);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--brand-border-strong);
}

.account-auth-section .account-auth-lead a:hover {
  color: var(--brand-primary);
  text-decoration-color: currentColor;
}

.account-auth-section .account-auth-lead a:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Notices ------------------------------------------------------------- */

.account-auth-section .account-auth-notices:not(:empty) {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto 1.25rem;
}

.account-auth-section .account-auth-card .woocommerce-message,
.account-auth-section .account-auth-card .woocommerce-info,
.account-auth-section .account-auth-card .woocommerce-error,
.account-auth-section .account-auth-notices .woocommerce-message,
.account-auth-section .account-auth-notices .woocommerce-info,
.account-auth-section .account-auth-notices .woocommerce-error {
  margin: 0 0 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius-lg);
  list-style: none;
}

.account-auth-section .account-auth-notices .woocommerce-message:last-child,
.account-auth-section .account-auth-notices .woocommerce-info:last-child,
.account-auth-section .account-auth-notices .woocommerce-error:last-child {
  margin-bottom: 0;
}

.account-auth-section .account-auth-card .woocommerce-message,
.account-auth-section .account-auth-notices .woocommerce-message {
  background-color: var(--brand-success-bg);
  border-color: var(--brand-success-border);
  color: var(--brand-success-fg);
}

.account-auth-section .account-auth-card .woocommerce-info,
.account-auth-section .account-auth-notices .woocommerce-info {
  background-color: var(--brand-surface-muted);
  border-color: var(--account-card-border);
  color: var(--brand-text-medium);
}

.account-auth-section .account-auth-card .woocommerce-error,
.account-auth-section .account-auth-notices .woocommerce-error {
  background-color: var(--brand-danger-soft-bg);
  border-color: rgba(var(--brand-danger-rgb), 0.2);
  color: var(--brand-danger);
}

.account-auth-section .account-auth-card .woocommerce-message a,
.account-auth-section .account-auth-card .woocommerce-info a,
.account-auth-section .account-auth-card .woocommerce-error a,
.account-auth-section .account-auth-notices .woocommerce-message a,
.account-auth-section .account-auth-notices .woocommerce-info a,
.account-auth-section .account-auth-notices .woocommerce-error a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* --- Form fields --------------------------------------------------------- */

.account-auth-section .account-auth-form {
  margin: 0;
}

.account-auth-section .account-auth-form .form-row {
  float: none;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
}

.account-auth-section .account-auth-form .form-row-wide,
.account-auth-section .account-auth-form .form-row-first,
.account-auth-section .account-auth-form .form-row-last {
  width: 100%;
  float: none;
}

.account-auth-section .account-auth-form label {
  display: block;
  margin-bottom: 0.375rem;
  color: var(--brand-text-strong);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.account-auth-section .account-auth-form .required {
  color: var(--brand-danger);
  text-decoration: none;
}

.account-auth-section .account-auth-form .input-text {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--input-border);
  border-radius: var(--bs-border-radius);
  background-color: var(--input-bg-elevated);
  color: var(--input-color);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-auth-section .account-auth-form .input-text:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 0;
  border-color: var(--input-focus-border);
}

.account-auth-section .account-auth-form .password-input {
  display: block;
}

.account-auth-section .account-auth-form .password-input .input-text {
  padding-right: 2.75rem;
}

.account-auth-section .account-auth-form .show-password-input {
  right: 0.75rem;
  min-width: 44px;
  min-height: 44px;
}

/* --- Remember me --------------------------------------------------------- */

.account-auth-section .account-auth-form__remember {
  margin-bottom: 0.5rem;
}

.account-auth-section .account-auth-form__remember .woocommerce-form__label-for-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  color: var(--brand-text-medium);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
}

.account-auth-section .account-auth-form__remember input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
}

.account-auth-section .account-auth-form__remember input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* --- Lost password link -------------------------------------------------- */

.account-auth-section .account-auth-form .lost_password {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.5;
}

.account-auth-section .account-auth-form .lost_password a {
  color: var(--brand-text-soft);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--brand-border-strong);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.account-auth-section .account-auth-form .lost_password a:hover {
  color: var(--brand-text-strong);
  text-decoration-color: currentColor;
}

.account-auth-section .account-auth-form .lost_password a:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Password strength meter --------------------------------------------- */

.account-auth-section .account-auth-form .woocommerce-password-strength {
  margin-top: 0.5rem;
  padding: 0.375rem 0.5rem;
  border: 0;
  border-radius: var(--bs-border-radius);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
}

.account-auth-section .account-auth-form .woocommerce-password-strength.short,
.account-auth-section .account-auth-form .woocommerce-password-strength.bad {
  background-color: var(--brand-danger-soft-bg);
  color: var(--brand-danger);
}

.account-auth-section .account-auth-form .woocommerce-password-strength.good {
  background-color: var(--brand-surface-muted);
  color: var(--brand-text-medium);
}

.account-auth-section .account-auth-form .woocommerce-password-strength.strong {
  background-color: var(--brand-success-bg);
  color: var(--brand-success-fg);
}

.account-auth-section .account-auth-form .woocommerce-password-hint {
  display: block;
  margin-top: 0.5rem;
  color: var(--brand-text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* --- Submit button ------------------------------------------------------- */

.account-auth-section .account-auth-form__submit {
  margin-top: 1.75rem;
  margin-bottom: 0;
}

.account-auth-section .account-auth-form__submit .button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--button-primary-bg);
  border-radius: var(--bs-border-radius);
  background-color: var(--button-primary-bg);
  color: var(--button-primary-color);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.account-auth-section .account-auth-form__submit .button:hover {
  background-color: var(--button-primary-hover-bg);
  border-color: var(--button-primary-hover-bg);
  color: var(--button-primary-color);
}

.account-auth-section .account-auth-form__submit .button:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.account-auth-section .account-auth-form__submit .button.disabled,
.account-auth-section .account-auth-form__submit .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --- Mobile -------------------------------------------------------------- */

@media (max-width: 767.98px) {
  .woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .account-auth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .woocommerce-account.woocommerce-lost-password .account-auth-section,
  .woocommerce-account:not(.logged-in):not(.woocommerce-lost-password) .account-auth-section {
    padding-top: clamp(1.75rem, 6vw, 2.5rem);
    padding-bottom: clamp(1.75rem, 6vw, 2.5rem);
  }

  .account-auth-section .account-auth-card {
    padding: 1.5rem;
  }

  .account-auth-section .account-auth-form .form-row {
    margin-bottom: 1.125rem;
  }
}

/* --- Account offcanvas: compact auth shell (no fullpage card/background) --- */

#offcanvas-user .account-auth-section--offcanvas {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

#offcanvas-user .account-auth-section--offcanvas .account-auth-notices:not(:empty) {
  max-width: none;
  margin: 0 0 1rem;
}

#offcanvas-user .account-auth-section--offcanvas .account-auth-offcanvas-block--register {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--account-card-border);
}

#offcanvas-user .account-auth-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 1rem;
}

/* ==========================================================================
   Germanized withdrawal page (Vertrag widerrufen)
   Reuses .account-auth-section / .account-auth-card / .account-auth-form
   Scoped via body.topix-withdrawal-page only.
   ========================================================================== */

.topix-withdrawal-page .entry-header {
  display: none;
}

.topix-withdrawal-page #content.site-content {
  padding-top: 0;
  padding-bottom: 0;
}

.topix-withdrawal-page .entry-content {
  padding-left: 0;
  padding-right: 0;
}

.topix-withdrawal-page .entry-content > .account-auth-section {
  margin-bottom: 0;
}

.topix-withdrawal-page .account-auth-section {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(2rem, 5vw, 6rem) clamp(1rem, 3vw, 1.5rem);
}

.topix-withdrawal-page .account-auth-section > .account-auth-card {
  max-width: 35rem;
  margin-inline: auto;
}

/* Germanized uses form-row-full; auth forms use form-row-wide — treat both as full width. */
.topix-withdrawal-page .account-auth-section .account-auth-form .form-row-full,
.topix-withdrawal-page .account-auth-section .account-auth-form .form-row-wide {
  float: none;
  width: 100%;
  clear: both;
}

/* Desktop: Vorname / Nachname side by side (Germanized form-row-first / form-row-last). */
@media (min-width: 768px) {
  .topix-withdrawal-page .account-auth-section .account-auth-form .form-row-first,
  .topix-withdrawal-page .account-auth-section .account-auth-form .form-row-last {
    float: left;
    width: 48%;
  }

  .topix-withdrawal-page .account-auth-section .account-auth-form .form-row-first {
    clear: left;
    margin-right: 0;
  }

  .topix-withdrawal-page .account-auth-section .account-auth-form .form-row-last {
    float: right;
    clear: right;
    margin-right: 0;
  }
}

.topix-withdrawal-page .account-auth-section .account-auth-form .clear {
  clear: both;
}

/* Select fields (logged-in order picker) and textareas. */
.topix-withdrawal-page .account-auth-section .account-auth-form select.input-text,
.topix-withdrawal-page .account-auth-section .account-auth-form textarea.input-text {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--input-border);
  border-radius: var(--bs-border-radius);
  background-color: var(--input-bg-elevated);
  color: var(--input-color);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topix-withdrawal-page .account-auth-section .account-auth-form textarea.input-text {
  min-height: 7rem;
  resize: vertical;
}

.topix-withdrawal-page .account-auth-section .account-auth-form select.input-text:focus-visible,
.topix-withdrawal-page .account-auth-section .account-auth-form textarea.input-text:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 0;
  border-color: var(--input-focus-border);
}

/* AJAX / inline notices inside the form. */
.topix-withdrawal-page .account-auth-section .account-auth-form .eu-owb-notice-wrapper:not(:empty) {
  margin-bottom: 1.25rem;
}

.topix-withdrawal-page .account-auth-section .account-auth-form .eu-owb-notice-wrapper .woocommerce-error,
.topix-withdrawal-page .account-auth-section .account-auth-form .eu-owb-notice-wrapper .woocommerce-message,
.topix-withdrawal-page .account-auth-section .account-auth-form .eu-owb-notice-wrapper .woocommerce-info {
  margin: 0;
  padding: 0.875rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius-lg);
  list-style: none;
}

.topix-withdrawal-page .account-auth-section .account-auth-form .woocommerce-info.notice {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--account-card-border);
  border-radius: var(--bs-border-radius-lg);
  background-color: var(--brand-surface-muted);
  color: var(--brand-text-medium);
}

.topix-withdrawal-page .account-auth-section .account-auth-form .woocommerce-invalid label {
  color: var(--brand-danger);
}

/* Partial withdrawal item table (logged-in / order-key flow). */
.topix-withdrawal-page .account-auth-section .account-auth-form .order-withdrawal-request-items-table {
  width: 100%;
  margin-bottom: 1.25rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.topix-withdrawal-page .account-auth-section .account-auth-form .order-withdrawal-request-items-table th,
.topix-withdrawal-page .account-auth-section .account-auth-form .order-withdrawal-request-items-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--account-card-border);
  vertical-align: middle;
}

@media (max-width: 575.98px) {
  .topix-withdrawal-page .account-auth-section {
    padding-top: clamp(1.75rem, 6vw, 2.5rem);
    padding-bottom: clamp(1.75rem, 6vw, 2.5rem);
  }
}
