/* Header login dropdown auth card for 55printing WP theme */

.topbar .ff-login-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Invisible bridge so moving from the trigger into the card does not fire mouseleave in the gap. */
.topbar .ff-login-dropdown-wrapper.force-hover-login::before,
.topbar .ff-login-dropdown-wrapper.mobile-dropdown-active::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: 100%;
  height: 14px;
}

.topbar .ff-login-trigger {
  cursor: pointer;
  border: 0;
  background: transparent;
  font: inherit;
}

.topbar .ff-login-dropdown {
  /* Stay rendered (display:block) but hidden via visibility/opacity so the card
     can fade + slide smoothly. Switching display:none <-> block cannot be
     animated, which is why the open/close used to snap instantly. */
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  /* Grow with the content (register / set-password / notifications) instead of
     capping the height and showing an ugly inner scrollbar. */
  max-height: none;
  overflow: visible;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.06);
  z-index: 10050;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  transform: translateY(-6px);
}

.topbar .ff-login-dropdown-wrapper.force-hover-login .ff-login-dropdown,
.topbar .ff-login-dropdown-wrapper.mobile-dropdown-active .ff-login-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0s;
}

.topbar .ff-login-dropdown-wrapper.force-hover-login .ff-login-trigger,
.topbar .ff-login-dropdown-wrapper.mobile-dropdown-active .ff-login-trigger {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.auth-widget { color: #334155; }
.auth-widget .hidden { display: none !important; }
.auth-widget .text-lg { font-size: 1.05rem; }
.auth-widget .text-2xl { font-size: 1.35rem; }
.auth-widget .text-sm { font-size: 0.875rem; }
.auth-widget .text-xs { font-size: 0.75rem; }
.auth-widget .text-gray-700 { color: #374151; }
.auth-widget .text-gray-600 { color: #4b5563; }
.auth-widget .text-gray-400 { color: #9ca3af; }
.auth-widget .text-center { text-align: center; }
.auth-widget .font-semibold { font-weight: 600; }
.auth-widget .font-bold { font-weight: 700; }
.auth-widget .font-medium { font-weight: 500; }
.auth-widget .mb-1 { margin-bottom: 0.25rem; }
.auth-widget .mb-4 { margin-bottom: 1rem; }
.auth-widget .mb-6 { margin-bottom: 1.5rem; }
.auth-widget .mt-2 { margin-top: 0.5rem; }
.auth-widget .mt-5 { margin-top: 1.25rem; }
.auth-widget .mt-6 { margin-top: 1.5rem; }
.auth-widget .w-full { width: 100%; }
.auth-widget .block { display: block; }
.auth-widget .flex { display: flex; }
.auth-widget .items-center { align-items: center; }
.auth-widget .justify-between { justify-content: space-between; }
.auth-widget .ml-2 { margin-left: 0.5rem; }

.ff-auth-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ff-auth-input:focus {
  outline: none;
  border-color: #558BCA;
  box-shadow: 0 0 0 3px rgba(85, 139, 202, 0.18);
}
.ff-auth-input--readonly,
.ff-auth-input[readonly] {
  background: #f3f4f6;
  color: #374151;
  cursor: default;
  border-color: #e5e7eb;
}
.ff-auth-input--readonly:focus,
.ff-auth-input[readonly]:focus {
  border-color: #e5e7eb;
  box-shadow: none;
}
.ff-auth-email-display {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #4b5563;
  word-break: break-word;
}

.ff-auth-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #558BCA;
}

.ff-auth-link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.ff-auth-link-btn:hover { color: #1d4ed8; text-decoration: underline; }

.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-gradient:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-gradient-blue {
  background: linear-gradient(135deg, #558BCA 0%, #7ab0e0 55%, #6366f1 100%);
  box-shadow: 0 8px 18px rgba(85, 139, 202, 0.28);
}

.ff-auth-register-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.24);
}

.ff-auth-logout-btn,
.ff-auth-admin-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.ff-auth-logout-btn { background: #ef4444; }
.ff-auth-logout-btn:hover { background: #dc2626; color: #fff; }
.ff-auth-admin-btn { background: #7c3aed; }
.ff-auth-admin-btn:hover { background: #6d28d9; color: #fff; }

/* Animated notifications (cheapRUSH pattern, 55printing brand polish) */
.auth-widget .notification,
.notification {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(.22, 1, .36, 1);
  transform: translateY(-4px);
  z-index: 1000;
}
.auth-widget .notification.hidden,
.notification.hidden {
  display: none !important;
}
.auth-widget .notification.visible,
.notification.visible {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.auth-widget .notification.hidden-animation,
.notification.hidden-animation {
  display: flex !important;
  animation: ffNotifFadeOut 0.5s forwards;
}
.auth-widget .notification .notification-content-wrapper,
.notification .notification-content-wrapper {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  max-width: 100%;
  display: inline-block;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.auth-widget .notification.success .notification-content-wrapper,
.notification.success .notification-content-wrapper {
  color: #065f46;
  background-color: rgba(236, 253, 245, 0.95);
  border-color: rgba(167, 243, 208, 0.9);
}
.auth-widget .notification.error .notification-content-wrapper,
.notification.error .notification-content-wrapper {
  color: #991b1b;
  background-color: rgba(254, 242, 242, 0.95);
  border-color: rgba(254, 202, 202, 0.9);
}
@keyframes ffNotifFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-4px); visibility: hidden; }
}

/* Smooth swap from login form to the logged-in account view */
.ff-auth-swap-in {
  animation: ffAuthSwapIn 0.45s cubic-bezier(.22, 1, .36, 1);
}
@keyframes ffAuthSwapIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ff-auth-swap-in { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-widget .notification,
  .notification {
    transition: none;
    transform: none;
  }
  .auth-widget .notification.hidden-animation,
  .notification.hidden-animation {
    animation: none;
  }
}

/* Login credential fields feedback while a sign-in attempt is in flight.
   Checking: dim to ~30% opacity (70% transparent) and lock input.
   Success: collapse + fade the fields away with a smooth animation. */
.ff-login-credential-field {
  transition: opacity 0.2s ease, max-height 0.35s ease, margin 0.35s ease,
    transform 0.35s ease, padding 0.35s ease;
  max-height: 200px;
  overflow: hidden;
}
#loginForm.ff-auth-checking .ff-login-credential-field {
  opacity: 0.3;
  pointer-events: none;
}
#loginForm.ff-auth-success .ff-login-credential-field {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
/* Animated first-login PIN flow.
   The password field slides/fades out and a "Send code" / PIN field slides in. */
#pinFlowBlock {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.22, 1, .36, 1), max-height 0.35s ease, margin 0.35s ease;
}
#pinFlowBlock.pin-flow-active {
  display: block !important;
  max-height: 720px;
  opacity: 1;
  transform: translateY(0);
}
.ff-verify-intro {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.45;
  margin: 0 0 12px;
  text-align: center;
}
.ff-verify-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 12px;
}
.ff-verify-tab {
  appearance: none;
  border: 1px solid #dbe3ef;
  background: #f8fafc;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ff-verify-tab:hover {
  border-color: #93c5fd;
  color: #1e40af;
}
.ff-verify-tab.is-active {
  background: #0b74da;
  border-color: #0b74da;
  color: #fff;
}
.ff-verify-panel {
  margin-top: 2px;
}
.ff-verify-help-card {
  background: #f0f6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}
.ff-verify-help-title {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}
.ff-verify-help-phone {
  display: inline-block;
  margin-top: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0b74da;
  text-decoration: none;
}
.ff-verify-help-phone:hover {
  text-decoration: underline;
}
.ff-verify-help-link {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}
@media (max-width: 420px) {
  .ff-verify-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#passwordFieldWrapper.password-exit {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
#passwordFieldWrapper {
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.22, 1, .36, 1), max-height 0.35s ease, margin 0.35s ease;
}
#sendPinButton {
  position: relative;
  min-height: 44px;
}
#sendPinButton.sending::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  right: 14px;
  top: 50%;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ffAuthSpin 0.8s linear infinite;
}
.ff-pin-hint {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
  margin: 10px 0 0;
  text-align: center;
}
.ff-pin-hint-subtle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 8px;
}
#pinInputStep {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(.22, 1, .36, 1);
}
#pinInputStep.pin-input-visible {
  opacity: 1;
  transform: translateY(0);
}
#setNewPasswordFormContainer {
  padding-top: 0.5rem;
}
#loginSubmitButton.pin-verify-mode {
  background: linear-gradient(135deg, #6366f1 0%, #558BCA 55%, #7ab0e0 100%);
}

@media (prefers-reduced-motion: reduce) {
  .ff-login-credential-field { transition: opacity 0.2s ease; }
  #pinFlowBlock,
  #passwordFieldWrapper,
  #pinInputStep { transition: opacity 0.2s ease; transform: none; }
}

/* Optional "add a shipping address" section on the registration form.
   A friendly toggle that expands a soft, rounded panel with the fields. */
.ff-reg-address { margin-bottom: 1.25rem; }
.ff-reg-address-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 1px dashed #b8c4d6;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff, #eef4ff);
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.ff-reg-address-toggle:hover {
  border-color: #6ea8fe;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}
.ff-reg-address-toggle-left { display: inline-flex; align-items: center; gap: 9px; text-align: left; }
.ff-reg-address-emoji { font-size: 1.15rem; line-height: 1; }
.ff-reg-address-optional { color: #94a3b8; font-weight: 500; font-size: 0.8rem; }
.ff-reg-address-chevron {
  font-size: 1.35rem;
  line-height: 1;
  color: #2563eb;
  transition: transform 0.28s cubic-bezier(.22, 1, .36, 1);
}
.ff-reg-address.open .ff-reg-address-chevron { transform: rotate(45deg); }
.ff-reg-address.open .ff-reg-address-toggle {
  border-style: solid;
  border-color: #6ea8fe;
  background: linear-gradient(135deg, #eef4ff, #e3edff);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.ff-reg-address-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}
.ff-reg-address.open .ff-reg-address-panel { max-height: 560px; opacity: 1; }
.ff-reg-address-panel-inner {
  padding: 14px;
  border: 1px solid #6ea8fe;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fbfdff;
}
.ff-reg-address-hint { font-size: 0.8rem; color: #64748b; margin-bottom: 12px; line-height: 1.4; }
.ff-reg-address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0.75rem;
}
@media (prefers-reduced-motion: reduce) {
  .ff-reg-address-panel { transition: opacity 0.2s ease; }
  .ff-reg-address-chevron { transition: none; }
}

.ff-social-login-block { margin-bottom: 14px; }
.ff-social-login-buttons { display: grid; gap: 10px; }
.ff-google-signin-slot {
  min-height: 44px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.ff-google-signin-slot.is-pending {
  border-radius: 999px;
  background: #f1f5f9;
}
.ff-google-signin-slot iframe {
  display: block;
}
.ff-social-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ff-social-divider::before,
.ff-social-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.ff-auth-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 3px solid rgba(85, 139, 202, 0.2);
  border-top-color: #558BCA;
  border-radius: 50%;
  animation: ffAuthSpin 0.8s linear infinite;
}
@keyframes ffAuthSpin { to { transform: rotate(360deg); } }

.ff-auth-row { gap: 10px; flex-wrap: wrap; }

.registration-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.registration-success-overlay.show {
  display: flex;
  opacity: 1;
}
.registration-success-overlay-content {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.3s cubic-bezier(.22, 1, .36, 1);
}
.registration-success-overlay.show .registration-success-overlay-content {
  transform: translateY(0) scale(1);
}
.registration-success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.success-checkmark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #fff;
  stroke-miterlimit: 10;
  box-shadow: inset 0 0 0 #22c55e;
  animation: ffCheckScale 0.3s ease-in-out 0.9s both;
}
.success-checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #22c55e;
  fill: none;
  animation: ffCheckStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.success-checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: #22c55e;
  stroke-width: 3;
  animation: ffCheckStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes ffCheckStroke {
  100% { stroke-dashoffset: 0; }
}
@keyframes ffCheckScale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.08, 1.08, 1); }
  to { box-shadow: inset 0 0 0 30px #22c55e; }
}
.registration-success-title {
  margin: 12px 0 8px;
  font-size: 1.35rem;
  color: #0f172a;
}
.registration-success-message {
  margin: 0 0 18px;
  color: #64748b;
  line-height: 1.5;
}
.registration-success-buttons {
  display: grid;
  gap: 10px;
}
.registration-success-btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}
.registration-success-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #558BCA 0%, #6366f1 100%);
}
.registration-success-btn-secondary {
  color: #334155;
  background: #f1f5f9;
}

@media (max-width: 991.98px) {
  .topbar .ff-login-dropdown-wrapper.mobile-dropdown-active .ff-login-dropdown {
    position: fixed;
    left: 50%;
    top: 1rem;
    right: auto;
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 2rem));
    /* Anchor to the top and grow downward. Only scroll internally when the
       form is genuinely taller than the device screen (unavoidable on phones). */
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 575.98px) {
  .topbar .ff-login-trigger .ff-login-label-long { display: none; }
  .topbar .ff-login-trigger .ff-login-label-short { display: inline; }
}

@media (min-width: 576px) {
  .topbar .ff-login-trigger .ff-login-label-short { display: none; }
}
