/**
 * Auth Modal Styles
 * Login / Register / Forgot Password modals
 * Based on Figma node: 637:81308, 2084:196166
 *
 * @package Momsides
 */

/* ===========================================
 * MODAL OVERLAY
 * =========================================== */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll when modal is open */
body.auth-modal-open {
  overflow: hidden;
}

/* ===========================================
 * MODAL CONTAINER
 * =========================================== */

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 448px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--color-white, #ffffff);
  border-radius: 16px;
  padding: 32px 24px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.auth-modal-overlay.is-active .auth-modal {
  transform: translateY(0);
}

/* Hide non-active modals */
.auth-modal[style*="display: none"] {
  display: none !important;
}

/* ===========================================
 * CLOSE BUTTON
 * =========================================== */

.auth-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.auth-modal__close:hover {
  opacity: 0.7;
}

.auth-modal__close svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===========================================
 * MODAL CONTENT
 * =========================================== */

.auth-modal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ===========================================
 * ILLUSTRATION
 * =========================================== */

.auth-modal__illustration {
  width: 154px;
  height: 171px;
  margin-bottom: 4px;
}

.auth-modal__illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===========================================
 * TITLE & SUBTITLE
 * =========================================== */

.auth-modal__title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 32px;
  color: var(--color-text, #303030);
  text-align: center;
  margin: 0;
}

.auth-modal__subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-secondary, #4D4D4D);
  text-align: center;
  margin: 0 0 8px;
}

/* ===========================================
 * FORM
 * =========================================== */

.auth-modal__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-modal__fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ===========================================
 * FORM FIELDS
 * =========================================== */

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-field__label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text, #303030);
}

.auth-field__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__input {
  width: 100%;
  height: 40px;
  padding: 10px 8px;
  background-color: var(--color-background-alt, #F6F6F6);
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-secondary, #4D4D4D);
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-field__input::placeholder {
  color: var(--color-placeholder, #878787);
}

.auth-field__input:focus {
  border-color: var(--color-primary, #6E4F95);
}

/* Input with icons */
.auth-field__input--with-icons {
  padding-left: 40px;
  padding-right: 40px;
}

/* Error state */
.auth-field.has-error .auth-field__input {
  border-color: var(--color-error, #FF5F57);
}

.auth-field__error {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: var(--color-error, #FF5F57);
  min-height: 16px;
}

/* ===========================================
 * FIELD ICONS
 * =========================================== */

.auth-field__icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
}

.auth-field__icon--left {
  left: 8px;
  pointer-events: none;
}

.auth-field__icon--right {
  right: 8px;
  cursor: pointer;
}

.auth-field__icon--right:hover svg path {
  stroke: var(--color-text-secondary, #4D4D4D);
}

.auth-field__icon svg {
  width: 24px;
  height: 24px;
}

/* ===========================================
 * FORGOT PASSWORD LINK
 * =========================================== */

.auth-modal__link {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: transparent;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-accent, #8FB56C);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.auth-modal__link:hover {
  opacity: 0.8;
}

/* ===========================================
 * SUBMIT BUTTON
 * =========================================== */

.auth-modal__submit {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--color-accent, #8FB56C);
  border: none;
  border-radius: 10px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
  color: var(--color-white, #ffffff);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.auth-modal__submit:hover {
  background-color: var(--color-accent-hover, #7DA35A);
}

.auth-modal__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Loader */
.auth-modal__submit-loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

/* ===========================================
 * FORM MESSAGES
 * =========================================== */

.auth-modal__error {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-error, #FF5F57);
  text-align: center;
  min-height: 0;
}

.auth-modal__error:not(:empty) {
  margin-top: -8px;
}

.auth-modal__success {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-accent, #8FB56C);
  text-align: center;
  padding: 12px;
  background-color: rgba(143, 181, 108, 0.1);
  border-radius: 8px;
}

/* ===========================================
 * SOCIAL LOGIN
 * =========================================== */

.auth-modal__social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.auth-modal__social-divider {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text, #000000);
  text-align: center;
}

.auth-modal__social-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.auth-modal__social-btn {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-modal__social-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.auth-modal__social-btn svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===========================================
 * SWITCH LINK
 * =========================================== */

.auth-modal__switch {
  padding: 0;
  border: none;
  background: transparent;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
  color: var(--color-accent, #8FB56C);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.auth-modal__switch:hover {
  opacity: 0.8;
}

/* ===========================================
 * RESPONSIVE
 * =========================================== */

@media (max-width: 480px) {
  .auth-modal {
    padding: 24px 16px;
    border-radius: 12px;
  }

  .auth-modal__illustration {
    width: 120px;
    height: 133px;
  }

  .auth-modal__title {
    font-size: 26px;
    line-height: 28px;
  }

  .auth-modal__submit {
    height: 44px;
  }
}

/* ===========================================
 * CHECKBOX FIELD
 * =========================================== */

.auth-field--checkbox {
  margin-top: 8px;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.auth-checkbox__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-checkbox__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-background-alt, #F6F6F6);
  border: 1px solid var(--color-border, #E0E0E0);
  border-radius: 4px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-checkbox__box svg {
  opacity: 0;
  color: var(--color-white, #ffffff);
  transition: opacity 0.2s ease;
}

.auth-checkbox__input:checked+.auth-checkbox__box {
  background-color: var(--color-accent, #8FB56C);
  border-color: var(--color-accent, #8FB56C);
}

.auth-checkbox__input:checked+.auth-checkbox__box svg {
  opacity: 1;
}

.auth-checkbox__input:focus+.auth-checkbox__box {
  border-color: var(--color-primary, #6E4F95);
  box-shadow: 0 0 0 2px rgba(110, 79, 149, 0.2);
}

.auth-field--checkbox.has-error .auth-checkbox__box {
  border-color: var(--color-error, #FF5F57);
}

.auth-checkbox__label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-secondary, #4D4D4D);
}

.auth-checkbox__link {
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  color: var(--color-accent, #8FB56C);
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

.auth-checkbox__link:hover {
  opacity: 0.8;
}

/* ===========================================
 * PRIVACY POLICY MODAL
 * =========================================== */

.privacy-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.privacy-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.privacy-modal {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-white, #ffffff);
  border-radius: 8px;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.privacy-modal-overlay.is-active .privacy-modal {
  transform: translateY(0);
}

.privacy-modal__header {
  padding: 24px 24px 16px;
  background-color: #C23B3B;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.privacy-modal__logo {
  max-width: 180px;
  height: auto;
  display: block;
}

.privacy-modal__title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  color: var(--color-white, #ffffff);
  margin: 0;
}

.privacy-modal__content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--color-text, #303030);
}

.privacy-modal__illustration {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.privacy-modal__illustration-img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  display: block;
}

.privacy-modal__content h2,
.privacy-modal__content h3,
.privacy-modal__content h4,
.privacy-modal__content h5,
.privacy-modal__content h6 {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  color: var(--color-text, #303030);
  margin: 24px 0 12px;
}

.privacy-modal__content h2 {
  font-size: 20px;
  line-height: 28px;
}

.privacy-modal__content h3 {
  font-size: 18px;
  line-height: 26px;
  margin-top: 32px;
}

.privacy-modal__content h3:first-child {
  margin-top: 0;
}

.privacy-modal__content h4 {
  font-size: 16px;
  line-height: 24px;
  margin: 20px 0 8px;
}

.privacy-modal__content p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  margin: 0 0 16px;
}

.privacy-modal__content p:last-child {
  margin-bottom: 0;
}

.privacy-modal__content ul,
.privacy-modal__content ol {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  line-height: 24px;
  margin: 0 0 16px;
  padding-left: 24px;
}

.privacy-modal__content li {
  margin-bottom: 8px;
}

.privacy-modal__content a {
  font-family: 'Source Sans 3', sans-serif;
  color: var(--color-accent, #8FB56C);
  text-decoration: underline;
}

.privacy-modal__content a:hover {
  opacity: 0.8;
}

.privacy-modal__content .privacy-policy-tutorial {
  display: none;
}

.privacy-modal__footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, #E0E0E0);
}

.privacy-modal__btn {
  padding: 12px 24px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.privacy-modal__btn:hover {
  opacity: 0.9;
}

.privacy-modal__btn--agree {
  background-color: #1A1A1A;
  color: var(--color-white, #ffffff);
}

.privacy-modal__btn--disagree {
  background-color: #6B6B6B;
  color: var(--color-white, #ffffff);
}

@media (max-width: 480px) {
  .privacy-modal {
    max-height: 90vh;
  }

  .privacy-modal__header {
    padding: 16px 16px 12px;
    gap: 12px;
  }

  .privacy-modal__logo {
    max-width: 140px;
  }

  .privacy-modal__illustration-img {
    width: 120px;
    height: 120px;
  }

  .privacy-modal__title {
    font-size: 20px;
    line-height: 28px;
  }

  .privacy-modal__content {
    padding: 16px;
    font-size: 14px;
    line-height: 22px;
  }

  .privacy-modal__footer {
    padding: 12px 16px;
    flex-direction: column;
  }

  .privacy-modal__btn {
    width: 100%;
    text-align: center;
  }
}