/* ============================================================
   FreshMarket Storefront — AUTH SYSTEM (Unified v2.0)
   ------------------------------------------------------------
   Covers:
   - Login
   - Activation Slider
   - Signup Slider
   - Modal Popup (Desktop)
   - Mobile-Friendly Centering
============================================================ */

/* ============================================================
   AUTH SECTION WRAPPER (Core Box)
============================================================ */
.sf-auth-section {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  padding: 20px;
  text-align: center;
  width: 100%;
  margin: 0 auto 20px;
  max-width: 440px; /* from checkout.css (correct value) */
  transition: height 0.3s ease;
}

/* ============================================================
   AUTH ICON + HEADERS
============================================================ */
.auth-icon {
  color: var(--color-primary, #28a745);
  width: 36px;
  height: 36px;
  margin-bottom: 6px;
}

.sf-auth-section h2,
.sf-signup-header h3 {
  color: var(--color-primary, #28a745);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.sf-auth-section p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 14px;
}

/* ============================================================
   LOGIN CONTAINER & SLIDER BASE
============================================================ */
.sf-login-container {
  position: relative;
  z-index: 1;
  transition: transform 0.35s ease;
}

/* Slide login left when activate/signup panel is active */
.sf-auth-section.signup-active .sf-login-container {
  transform: translateX(-100%);
}

/* Signup/Activation Slide Panel */
.sf-signup-slider {
  position: absolute;
  top: 0;
  left: 100%;
  width: 100%;
  height: 100%;
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  box-sizing: border-box;
  transition: left 0.35s ease;
  z-index: 2;
}

.sf-auth-section.signup-active .sf-signup-slider {
  left: 0;
}

/* Signup step content */
.sf-step {
  transition: opacity 0.3s ease, transform 0.35s ease;
  width: 100%;
}

.sf-step.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.sf-signup-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ============================================================
   INPUT FIELDS
============================================================ */
.sf-input {
  display: flex;
  align-items: center;
  border: 1px solid #e1e5e1;
  border-radius: 8px;
  padding: 12px 16px;
  background: #f7f9f7;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sf-input svg,
.sf-input i {
  width: 20px;
  height: 20px;
  color: #bbb;
  stroke: #bbb;
  margin-right: 14px;
  flex-shrink: 0;
  transition: stroke 0.25s ease;
}

.sf-input input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 14px;
  color: #222;
  line-height: 1.4;
  padding: 2px 0;
}

.sf-input input::placeholder {
  color: #bbb;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.sf-input.has-text input::placeholder {
  opacity: 0;
}

.sf-input:focus-within {
  border-color: var(--color-primary, #28a745);
  background: #fff;
}

.sf-input:focus-within svg,
.sf-input:focus-within i {
  stroke: var(--color-primary, #28a745);
  color: var(--color-primary, #28a745);
}

/* ============================================================
   BUTTONS
============================================================ */
.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.sf-btn-primary {
  background: var(--mh-primary-dark);
  color: #fff;
}

.sf-btn-primary:hover {
  background: var(--color-primary-dark, #218838);
  transform: scale(1.02);
}

.sf-btn-dark {
  background: #444;
  color: #fff;
}

.sf-btn-dark:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sf-btn-light {
  background: #f3f3f3;
  color: #333;
}

.w-full {
  width: 100%;
}

/* ============================================================
   MESSAGE AREA + TEXT HELPERS
============================================================ */
.sf-message-area {
  margin-bottom: 12px;
}

.sf-msg {
  font-size: 0.9rem;
  line-height: 1.4;
  border-radius: 6px;
  padding: 10px 12px;
}

.sf-msg.info {
  background: #f2fdf3;
  color: #155724;
  border: 1px solid #d4edda;
}

.sf-divider {
  border-top: 1px solid #eee;
  margin: 16px 0;
}

.sf-alt-text {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  margin-top: 10px;
}

.sf-link {
  color: var(--color-primary, #28a745);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.sf-link:hover {
  text-decoration: underline;
}

/* Prevent "Activate Account" from breaking into 2 rows */
.no-break {
  white-space: nowrap;
}

/* ============================================================
   SIGNUP OVERLAY BACKGROUND
============================================================ */
.sf-signup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  display: none;
}

.sf-signup-overlay.active {
  display: block;
}

/* ============================================================
   DESKTOP: LOGIN / ACTIVATION AS MODAL POPUP
============================================================ */
@media (min-width: 768px) {

  .sf-auth-modal-desktop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0,0,0,0.45);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      z-index: 9999;
  }

  .sf-auth-modal-desktop .sf-auth-section {
      background: #fff;
      border-radius: 16px;
      max-width: 480px !important;
      width: 100%;
      padding: 32px 28px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.15);
      animation: sfAuthPop 0.25s ease;
  }

  @keyframes sfAuthPop {
      from { transform: translateY(10px); opacity: 0; }
      to   { transform: translateY(0); opacity: 1; }
  }
}

/* ============================================================
   MOBILE — Center login/activation vertically
============================================================ */
@media (max-width: 767px) {

  .sf-auth-main {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      padding: 20px 0;
  }

  .sf-auth-container {
      width: 100%;
      max-width: 420px;
      margin: 0 auto;
  }

  .sf-auth-section {
      max-width: 420px;
  }
}

/* ============================================================
   Login Close Button (Top-Right)
============================================================ */
.sf-auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f2f2f2;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.sf-auth-close i {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.sf-auth-close:hover {
    background: #e6e6e6;
    transform: scale(1.05);
}

.sf-auth-close:active {
    transform: scale(0.95);
}



/* ============================================================
   EXTRA SMALL DEVICES ADJUSTMENTS
============================================================ */
@media (max-width: 600px) {
  .sf-auth-section {
    padding: 16px;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .sf-signup-slider {
    padding: 16px;
  }
  .sf-input {
    padding: 10px 12px;
  }
  .sf-btn {
    font-size: 13px;
    padding: 9px 14px;
  }
}
