/* ==========================================================================
   AUTH PAGE STYLES (LOGIN/REGISTER)
   ========================================================================== */

main.auth-page {
  background-color: var(--body-background);

  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  padding-top: calc(
    var(--top-bar-height, 0px) + var(--header-height, 80px) + 40px
  );
}

.auth-container {
  max-width: 900px;
  width: 100%;
}

/* Header */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-title {
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-lg);
  color: var(--text);
  opacity: 0.7;
}

/* Form Container */
.auth-forms-container {
  border-radius: var(--border-radius, 12px);
  padding: var(--space-8);
}

@media (max-width: 768px) {
  .auth-forms-container {
    padding: var(--space-6) var(--space-4);
  }
}

/* Forms Grid */
.auth-forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

@media (max-width: 768px) {
  .auth-forms-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* Form Sections */
.auth-form-section {
  position: relative;
}

.auth-form-section h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--border-light);
}

/* Divider between forms */
.auth-forms-grid > .auth-form-section:first-child::after {
  content: "";
  position: absolute;
  right: calc(var(--space-8) * -0.5);
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--border-light);
}

@media (max-width: 768px) {
  .auth-forms-grid > .auth-form-section:first-child::after {
    display: none;
  }
}

/* Form Styling */
.woocommerce-form-login,
.woocommerce-form-register {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.woocommerce-form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.woocommerce-form-row label {
  font-weight: 600;
  color: var(--text);
  font-size: var(--text-sm);
}

.woocommerce-form-row .required {
  color: var(--error);
}

/* Input Fields */
.woocommerce-Input,
.woocommerce-form-row input[type="text"],
.woocommerce-form-row input[type="email"],
.woocommerce-form-row input[type="password"] {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius, 8px);
  font-size: var(--text-base);
  transition: all 0.3s ease;
  background-color: var(--white);
}

.woocommerce-Input:focus,
.woocommerce-form-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(246, 176, 85, 0.1);
}

/* Checkbox */
.woocommerce-form__label-for-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text);
}

.woocommerce-form__label-for-checkbox input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
}

/* Buttons */
.woocommerce-Button,
.woocommerce-form-login button[type="submit"],
.woocommerce-form-register button[type="submit"] {
  width: 100%;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--border-radius, 8px);
  border: none;

  font-size: var(--text-base);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.woocommerce-form-login button[type="submit"] {
  background-color: var(--primary) !important;
  color: var(--text-color) !important;
}

.woocommerce-form-login button[type="submit"]:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.woocommerce-form-register button[type="submit"] {
  background-color: var(--secondary);
  color: var(--text-light);
}

.woocommerce-form-register button[type="submit"]:hover {
  background-color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Links */
.woocommerce-LostPassword a {
  color: var(--primary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all 0.3s ease;
}

.woocommerce-LostPassword a:hover {
  text-decoration: underline;
}

/* Messages */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info,
.woocommerce-notice {
  position: relative;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--border-radius, 12px);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
  border-left: 5px solid;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.06);
  color: var(--text);
  line-height: 1.55;
}

.woocommerce-error {
  background: linear-gradient(
    135deg,
    rgb(239 68 68 / 0.16) 0%,
    rgb(239 68 68 / 0.08) 100%
  );
  border-color: rgb(239 68 68 / 0.28);
  border-left-color: var(--error);
}

.woocommerce-message {
  background: linear-gradient(
    135deg,
    rgb(16 185 129 / 0.16) 0%,
    rgb(16 185 129 / 0.08) 100%
  );
  border-color: rgb(16 185 129 / 0.28);
  border-left-color: var(--success);
}

.woocommerce-info {
  background: linear-gradient(
    135deg,
    rgb(59 130 246 / 0.14) 0%,
    rgb(59 130 246 / 0.08) 100%
  );
  border-color: rgb(59 130 246 / 0.24);
  border-left-color: #3b82f6;
}

.woocommerce-notice {
  background: linear-gradient(
    135deg,
    rgb(246 176 85 / 0.2) 0%,
    rgb(246 176 85 / 0.09) 100%
  );
  border-color: rgb(246 176 85 / 0.3);
  border-left-color: var(--primary);
}

.woocommerce-error a,
.woocommerce-message a,
.woocommerce-info a,
.woocommerce-notice a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.woocommerce-error a:hover,
.woocommerce-message a:hover,
.woocommerce-info a:hover,
.woocommerce-notice a:hover {
  text-decoration: none;
}

/* Half-width row for first/last name */
.auth-form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 480px) {
  .auth-form-row-half {
    grid-template-columns: 1fr;
  }
}

/* Single Form Layout (when registration is disabled) */
.auth-single-form {
  max-width: 450px;
  margin: 0 auto;
}

.auth-single-form h2 {
  text-align: center;
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-6);
}

.auth-switch-link {
  text-align: center;
  margin-top: var(--space-2);
}

.auth-switch-link a {
  color: var(--primary);
  font-size: var(--text-sm);
  text-decoration: none;
}

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

/* Lost Password Template */
.woocommerce-lost-password .woocommerce,
.woocommerce-reset-password .woocommerce {
  max-width: 450px;
  margin: 0 auto;
}

.woocommerce-lost-password .woocommerce h1,
.woocommerce-lost-password .woocommerce h2,
.woocommerce-lost-password .woocommerce h3,
.woocommerce-reset-password .woocommerce h1,
.woocommerce-reset-password .woocommerce h2,
.woocommerce-reset-password .woocommerce h3 {
  text-align: center;
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-4);
}

.woocommerce-lost-password .woocommerce .woocommerce-form,
.woocommerce-reset-password .woocommerce .woocommerce-ResetPassword {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.woocommerce .woocommerce-ResetPassword {
  max-width: 560px;
  margin: 0 auto;
}

.woocommerce .woocommerce-ResetPassword .form-row-first,
.woocommerce .woocommerce-ResetPassword .form-row-last,
.woocommerce .woocommerce-ResetPassword .form-row-wide {
  width: 100%;
  float: none;
  margin-right: 0;
}

.woocommerce .woocommerce-ResetPassword .clear {
  display: none;
}

.woocommerce-lost-password .woocommerce .woocommerce-form-row,
.woocommerce-reset-password .woocommerce .woocommerce-form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.woocommerce-lost-password .woocommerce .woocommerce-form-row label,
.woocommerce-reset-password .woocommerce .woocommerce-form-row label {
  font-weight: 600;
  color: var(--text);
  font-size: var(--text-sm);
}

.woocommerce-lost-password
  .woocommerce
  .woocommerce-form-row
  input[type="text"],
.woocommerce-lost-password
  .woocommerce
  .woocommerce-form-row
  input[type="email"],
.woocommerce-lost-password
  .woocommerce
  .woocommerce-form-row
  input[type="password"],
.woocommerce-reset-password
  .woocommerce
  .woocommerce-form-row
  input[type="text"],
.woocommerce-reset-password
  .woocommerce
  .woocommerce-form-row
  input[type="email"],
.woocommerce-reset-password
  .woocommerce
  .woocommerce-form-row
  input[type="password"] {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius, 8px);
  font-size: var(--text-base);
  background-color: var(--white);
  transition: all 0.3s ease;
}

.woocommerce-lost-password .woocommerce .woocommerce-form-row input:focus,
.woocommerce-reset-password .woocommerce .woocommerce-form-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(246, 176, 85, 0.1);
}

.woocommerce-lost-password .woocommerce .woocommerce-Button,
.woocommerce-reset-password .woocommerce .woocommerce-Button,
.woocommerce-lost-password .woocommerce button[type="submit"],
.woocommerce-reset-password .woocommerce button[type="submit"] {
  width: 100%;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--border-radius, 8px);
  border: none;
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.woocommerce .woocommerce-ResetPassword .woocommerce-Button,
.woocommerce .woocommerce-ResetPassword button.button {
  width: 100%;
}

.woocommerce-lost-password .woocommerce .woocommerce-Button:hover,
.woocommerce-reset-password .woocommerce .woocommerce-Button:hover,
.woocommerce-lost-password .woocommerce button[type="submit"]:hover,
.woocommerce-reset-password .woocommerce button[type="submit"]:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.woocommerce-lost-password .woocommerce p,
.woocommerce-reset-password .woocommerce p {
  color: var(--text);
}

.woocommerce-privacy-policy-link {
  color: var(--primary);
  text-decoration: none;
}

/* Lost/Reset Password Page Layout Fixes */
body.woocommerce-lost-password .container,
body.woocommerce-reset-password .container {
  max-width: 1200px;
}

body.woocommerce-lost-password .container .prose,
body.woocommerce-reset-password .container .prose {
  max-width: 700px;
  margin: clamp(1.5rem, 3vw, 2.5rem) auto;
  padding: clamp(1rem, 2.5vw, 2rem);
}

body.woocommerce-lost-password .container .prose .woocommerce,
body.woocommerce-reset-password .container .prose .woocommerce {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius, 12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

body.woocommerce-lost-password .container .prose .woocommerce p,
body.woocommerce-reset-password .container .prose .woocommerce p {
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

body.woocommerce-lost-password
  .container
  .prose
  .woocommerce
  .woocommerce-ResetPassword::before {
  content: "Återställ lösenord";
  display: block;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: var(--space-4);
  color: var(--text);
}

body.woocommerce-reset-password
  .container
  .prose
  .woocommerce
  .woocommerce-ResetPassword::before {
  content: "Valj nytt losenord";
  display: block;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: var(--space-4);
  color: var(--text);
}

body.woocommerce-lost-password
  .container
  .prose
  .woocommerce
  .woocommerce-form-row,
body.woocommerce-reset-password
  .container
  .prose
  .woocommerce
  .woocommerce-form-row {
  margin-bottom: var(--space-4);
}

@media (max-width: 767px) {
  body.woocommerce-lost-password .container .prose,
  body.woocommerce-reset-password .container .prose {
    margin: var(--space-4) auto;
    padding: 0;
  }

  body.woocommerce-lost-password .container .prose .woocommerce,
  body.woocommerce-reset-password .container .prose .woocommerce {
    border-radius: 10px;
    padding: var(--space-4);
  }
}
